Skip to content

delete_custom_metadata async

delete_custom_metadata(
    resource_id: ResourceIdType,
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    version_id: Optional[DocumentVersionIdType] = None,
    keys: Optional[CustomMetadataKeyList] = None,
    delete_all: Optional[BooleanType] = None,
) -> DeleteCustomMetadataResponse

Deletes custom metadata from the specified resource.

Parameters:

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

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

  • resource_id (ResourceIdType) –

    The ID of the resource, either a document or folder.

  • version_id (Optional[DocumentVersionIdType], default: None ) –

    The ID of the version, if the custom metadata is being deleted from a document version.

  • keys (Optional[CustomMetadataKeyList], default: None ) –

    List of properties to remove.

  • delete_all (Optional[BooleanType], default: None ) –

    Flag to indicate removal of all custom metadata properties from the specified resource.

Raises:

Source code in docs_src/capo_workdocs/_services/async_work_docs.py
async def delete_custom_metadata(
    self,
    resource_id: "capo_workdocs.types.resource_id_type.ResourceIdType",
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    version_id: Optional[
        "capo_workdocs.types.document_version_id_type.DocumentVersionIdType"
    ] = None,
    keys: Optional[
        "capo_workdocs.types.custom_metadata_key_list.CustomMetadataKeyList"
    ] = None,
    delete_all: Optional["capo_workdocs.types.boolean_type.BooleanType"] = None,
) -> "capo_workdocs.types.delete_custom_metadata_response.DeleteCustomMetadataResponse":
    """<p>Deletes custom metadata from the specified resource.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        resource_id: <p>The ID of the resource, either a document or folder.</p>
        version_id: <p>The ID of the version, if the custom metadata is being deleted from a document version.</p>
        keys: <p>List of properties to remove.</p>
        delete_all: <p>Flag to indicate removal of all custom metadata properties from the specified resource.</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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workdocs.types.delete_custom_metadata_request.DeleteCustomMetadataRequest]",
    ) -> AsyncOperationResponse[
        "capo_workdocs.types.delete_custom_metadata_response.DeleteCustomMetadataResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.delete_custom_metadata

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

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

        return capo_workdocs.types.delete_custom_metadata_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DeleteCustomMetadata", redact_input=_redact_input),
    )
    input_: capo_workdocs.types.delete_custom_metadata_request.DeleteCustomMetadataRequest = {
        "resource_id": resource_id
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if version_id is not None:
        input_["version_id"] = version_id
    if keys is not None:
        input_["keys"] = keys
    if delete_all is not None:
        input_["delete_all"] = delete_all

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