Skip to content

get_attachment_download_link async

get_attachment_download_link(
    attachment_id: AttachmentId,
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    dry_run: Optional[NullableBooleanType] = None,
) -> GetAttachmentDownloadLinkResponse

Returns a presigned download URL for an attachment that is associated with a case communication. The download link works for an attachment of any size, including attachments added through AddAttachmentsToSet and attachments uploaded through GetAttachmentUploadLinks. The download URL is time-limited and expires at the date and time indicated in the downloadUrl response field. Download the attachment from the URL before it expires.

  • You must have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan to use the Amazon Web Services Support API. If you're in an Amazon Web Services Region that doesn't offer one of these Amazon Web Services Support plans, or if you haven't transitioned to one of these plans, you can use the Amazon Web Services Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.

  • If you call the Amazon Web Services Support API from an account that doesn't have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan, the SubscriptionRequiredException error message appears. For information about changing your support plan, see Amazon Web Services Support.

Parameters:

  • attachment_id (AttachmentId) –

    The unique identifier of the attachment for which to retrieve a download link. Attachment IDs are returned in the AttachmentDetails objects in the attachments field of a Communication returned by DescribeCommunications or DescribeCases.

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

    Specifies whether to validate the request without actually returning a download link. When set to true, the request is validated but no URL is returned, 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 get_attachment_download_link(
    self,
    attachment_id: "capo_support.types.attachment_id.AttachmentId",
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    dry_run: Optional[
        "capo_support.types.nullable_boolean_type.NullableBooleanType"
    ] = None,
) -> "capo_support.types.get_attachment_download_link_response.GetAttachmentDownloadLinkResponse":
    """<p>Returns a presigned download URL for an attachment that is associated with a case communication. The download link works for an attachment of any size, including attachments added through <code>AddAttachmentsToSet</code> and attachments uploaded through <a>GetAttachmentUploadLinks</a>. The download URL is time-limited and expires at the date and time indicated in the <code>downloadUrl</code> response field. Download the attachment from the URL before it expires.</p> <note> <ul> <li> <p>You must have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan to use the Amazon Web Services Support API. If you're in an Amazon Web Services Region that doesn't offer one of these Amazon Web Services Support plans, or if you haven't transitioned to one of these plans, you can use the Amazon Web Services Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.</p> </li> <li> <p>If you call the Amazon Web Services Support API from an account that doesn't have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan, the <code>SubscriptionRequiredException</code> error message appears. For information about changing your support plan, see <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a>.</p> </li> </ul> </note>

    Args:
        attachment_id: <p>The unique identifier of the attachment for which to retrieve a download link. Attachment IDs are returned in the <code>AttachmentDetails</code> objects in the <code>attachments</code> field of a <a>Communication</a> returned by <a>DescribeCommunications</a> or <a>DescribeCases</a>.</p>
        dry_run: <p>Specifies whether to validate the request without actually returning a download link. When set to <code>true</code>, the request is validated but no URL is returned, 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.attachment_id_not_found.AttachmentIdNotFound: <p>An attachment with the specified ID could not be found.</p>
        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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_support.types.get_attachment_download_link_request.GetAttachmentDownloadLinkRequest]",
    ) -> AsyncOperationResponse[
        "capo_support.types.get_attachment_download_link_response.GetAttachmentDownloadLinkResponse"
    ]:
        import capo_support._operations.aws_support_20130415.get_attachment_download_link

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAttachmentDownloadLink")
    )
    input_: capo_support.types.get_attachment_download_link_request.GetAttachmentDownloadLinkRequest = {
        "attachment_id": attachment_id
    }
    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