Skip to content

complete_attachment_upload async

complete_attachment_upload(
    upload_id: UploadId,
    completed_uploads: CompletedUploadList,
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    dry_run: Optional[NullableBooleanType] = None,
) -> CompleteAttachmentUploadResponse

Completes an attachment upload that was started with GetAttachmentUploadLinks. After you upload a part of the file to its presigned Amazon S3 URL, call CompleteAttachmentUpload with the partIndex and eTag of that part. You can include one part per call, or multiple parts in a single call. After CompleteAttachmentUpload has been called for every part of the file, the service processes the upload asynchronously. The attachment-ready status might not be reflected immediately. Use DescribeAttachmentUploadStatus to poll for the uploadStatus to become attachment-ready before passing the uploadId to CreateCase or AddCommunicationToCase.

Parameters:

  • upload_id (UploadId) –

    The identifier associated with the upload to complete.

  • completed_uploads (CompletedUploadList) –

    The list of parts being reported as completed in this call. Each entry must contain the partIndex of an uploaded part and the ETag returned by Amazon S3 when that part was uploaded.

  • dry_run (Optional[NullableBooleanType], default: None ) –

    Specifies whether to validate the request without actually completing the upload. When set to true, the request is validated but the upload isn't finalized, and the operation returns a DryRunOperationException. When omitted or set to false, the request runs normally.

Raises:

Source code in docs_src/capo_support/_services/async_support.py
async def complete_attachment_upload(
    self,
    upload_id: "capo_support.types.upload_id.UploadId",
    completed_uploads: "capo_support.types.completed_upload_list.CompletedUploadList",
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    dry_run: Optional[
        "capo_support.types.nullable_boolean_type.NullableBooleanType"
    ] = None,
) -> "capo_support.types.complete_attachment_upload_response.CompleteAttachmentUploadResponse":
    """<p>Completes an attachment upload that was started with <a>GetAttachmentUploadLinks</a>. After you upload a part of the file to its presigned Amazon S3 URL, call <code>CompleteAttachmentUpload</code> with the <code>partIndex</code> and <code>eTag</code> of that part. You can include one part per call, or multiple parts in a single call. After <code>CompleteAttachmentUpload</code> has been called for every part of the file, the service processes the upload asynchronously. The <code>attachment-ready</code> status might not be reflected immediately. Use <a>DescribeAttachmentUploadStatus</a> to poll for the <code>uploadStatus</code> to become <code>attachment-ready</code> before passing the <code>uploadId</code> to <a>CreateCase</a> or <a>AddCommunicationToCase</a>.</p>

    Args:
        upload_id: <p>The identifier associated with the upload to complete.</p>
        completed_uploads: <p>The list of parts being reported as completed in this call. Each entry must contain the <code>partIndex</code> of an uploaded part and the <code>ETag</code> returned by Amazon S3 when that part was uploaded.</p>
        dry_run: <p>Specifies whether to validate the request without actually completing the upload. When set to <code>true</code>, the request is validated but the upload isn't finalized, and the operation returns a <code>DryRunOperationException</code>. When omitted or set to <code>false</code>, the request runs normally.</p>

    Raises:
        capo_support.errors.dry_run_operation_exception.DryRunOperationException: <p>The request was valid, but the operation wasn't performed because <code>dryRun</code> was set to <code>true</code>.</p>
        capo_support.errors.internal_server_error.InternalServerError: <p>An internal server error occurred.</p>
        capo_support.errors.upload_id_not_found.UploadIdNotFound: <p>The specified <code>uploadId</code> couldn't be located.</p>
        capo_support.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_support.types.complete_attachment_upload_request.CompleteAttachmentUploadRequest]",
    ) -> AsyncOperationResponse[
        "capo_support.types.complete_attachment_upload_response.CompleteAttachmentUploadResponse"
    ]:
        import capo_support._operations.aws_support_20130415.complete_attachment_upload

        (
            output,
            http_response,
        ) = await capo_support._operations.aws_support_20130415.complete_attachment_upload.async_complete_attachment_upload(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CompleteAttachmentUpload")
    )
    input_: capo_support.types.complete_attachment_upload_request.CompleteAttachmentUploadRequest = {
        "upload_id": upload_id,
        "completed_uploads": completed_uploads,
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

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