Skip to content

delete_artifact async

delete_artifact(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    artifact_arn: Optional[ArtifactArn] = None,
    source: Optional[ArtifactSource] = None,
) -> DeleteArtifactResponse

Deletes an artifact. Either ArtifactArn or Source must be specified.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def delete_artifact(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    artifact_arn: Optional["capo_sagemaker.types.artifact_arn.ArtifactArn"] = None,
    source: Optional["capo_sagemaker.types.artifact_source.ArtifactSource"] = None,
) -> "capo_sagemaker.types.delete_artifact_response.DeleteArtifactResponse":
    """<p>Deletes an artifact. Either <code>ArtifactArn</code> or <code>Source</code> must be specified.</p>

    Args:
        artifact_arn: <p>The Amazon Resource Name (ARN) of the artifact to delete.</p>
        source: <p>The URI of the source.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.delete_artifact_request.DeleteArtifactRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.delete_artifact_response.DeleteArtifactResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.delete_artifact

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.delete_artifact.async_delete_artifact(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteArtifact")
    )
    input_: capo_sagemaker.types.delete_artifact_request.DeleteArtifactRequest = {}
    if artifact_arn is not None:
        input_["artifact_arn"] = artifact_arn
    if source is not None:
        input_["source"] = source

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