Skip to content

delete_attachment

delete_attachment(
    asset_identifier: AssetId,
    attachment_name: AttachmentName,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    iterable_form_name: Optional[IterableFormName] = None,
    item_identifier: Optional[ItemIdentifier] = None,
) -> DeleteAttachmentResponse

Deletes a form attachment from an asset in Glue Data Catalog.

Parameters:

  • asset_identifier (AssetId) –

    The unique identifier of the asset from which to delete the attachment.

  • iterable_form_name (Optional[IterableFormName], default: None ) –

    The name of the iterable form. When specified along with itemIdentifier, the attachment is deleted from an item within the iterable form rather than from the asset itself.

  • item_identifier (Optional[ItemIdentifier], default: None ) –

    The identifier of the item within the iterable form. Required when iterableFormName is specified.

  • attachment_name (AttachmentName) –

    The name of the attachment to delete.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def delete_attachment(
    self,
    asset_identifier: "capo_glue.types.asset_id.AssetId",
    attachment_name: "capo_glue.types.attachment_name.AttachmentName",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    iterable_form_name: Optional[
        "capo_glue.types.iterable_form_name.IterableFormName"
    ] = None,
    item_identifier: Optional[
        "capo_glue.types.item_identifier.ItemIdentifier"
    ] = None,
) -> "capo_glue.types.delete_attachment_response.DeleteAttachmentResponse":
    """<p>Deletes a form attachment from an asset in Glue Data Catalog.</p>

    Args:
        asset_identifier: <p>The unique identifier of the asset from which to delete the attachment.</p>
        iterable_form_name: <p>The name of the iterable form. When specified along with <code>itemIdentifier</code>, the attachment is deleted from an item within the iterable form rather than from the asset itself.</p>
        item_identifier: <p>The identifier of the item within the iterable form. Required when <code>iterableFormName</code> is specified.</p>
        attachment_name: <p>The name of the attachment to delete.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.throttling_exception.ThrottlingException: <p>The throttling threshhold was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.delete_attachment_request.DeleteAttachmentRequest]",
    ) -> OperationResponse[
        "capo_glue.types.delete_attachment_response.DeleteAttachmentResponse"
    ]:
        import capo_glue._operations.aws_glue.delete_attachment

        output, http_response = (
            capo_glue._operations.aws_glue.delete_attachment.delete_attachment(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteAttachment")
    )
    input_: capo_glue.types.delete_attachment_request.DeleteAttachmentRequest = {
        "asset_identifier": asset_identifier,
        "attachment_name": attachment_name,
    }
    if iterable_form_name is not None:
        input_["iterable_form_name"] = iterable_form_name
    if item_identifier is not None:
        input_["item_identifier"] = item_identifier

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