Skip to content

get_campaign_asset_export_task

get_campaign_asset_export_task(
    catalog: Catalog,
    campaign_identifier: CampaignIdentifier,
    campaign_asset_export_task_identifier: CampaignAssetExportTaskId,
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> GetCampaignAssetExportTaskResponse

Retrieves a campaign asset export task by its identifier, reporting its status and, when the task is COMPLETED, a freshly minted short-lived presigned URL for downloading the ZIP archive. The download URL is minted on each call and is valid for at most 15 minutes; clients should download promptly rather than caching it. When the task has FAILED, FailureReason explains why. Poll this operation (roughly every 2-5 seconds) until the task reaches a terminal state.

Parameters:

  • catalog (Catalog) –

    The catalog (AWS or Sandbox).

  • campaign_identifier (CampaignIdentifier) –

    The campaign that owns the export task. Accepts the campaign id or ARN. Required so the read is authorized on campaign/{CampaignId}; the task must belong to this campaign or the request resolves to not-found.

  • campaign_asset_export_task_identifier (CampaignAssetExportTaskId) –

    The export task to retrieve: the Id StartCampaignAssetExportTask returned (etsk-…). An id only. An export task has no ARN: none is returned, recorded or authorized on (the read authorizes on its campaign), so there is no ARN to accept (DG-063 D-35).

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. An IAM denial carries no Reason. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence.

  • InternalServerException –

    An unexpected error occurred during the processing of the request.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service. A caller branches on Reason, and where the rejection is attributable to particular fields it reads FieldList rather than parsing Message, which is prose and may change.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
def get_campaign_asset_export_task(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    campaign_identifier: "capo_partnercentral_marketing.types.campaign_identifier.CampaignIdentifier",
    campaign_asset_export_task_identifier: "capo_partnercentral_marketing.types.campaign_asset_export_task_id.CampaignAssetExportTaskId",
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> "capo_partnercentral_marketing.types.get_campaign_asset_export_task_response.GetCampaignAssetExportTaskResponse":
    """Retrieves a campaign asset export task by its identifier, reporting its status and, when the task is COMPLETED, a freshly minted short-lived presigned URL for downloading the ZIP archive. The download URL is minted on each call and is valid for at most 15 minutes; clients should download promptly rather than caching it. When the task has FAILED, FailureReason explains why. Poll this operation (roughly every 2-5 seconds) until the task reaches a terminal state.

    Args:
        catalog: The catalog (AWS or Sandbox).
        campaign_identifier: The campaign that owns the export task. Accepts the campaign id or ARN. Required so the read is authorized on campaign/{CampaignId}; the task must belong to this campaign or the request resolves to not-found.
        campaign_asset_export_task_identifier: The export task to retrieve: the `Id` StartCampaignAssetExportTask returned (`etsk-…`). An id only. An export task has no ARN: none is returned, recorded or authorized on (the read authorizes on its campaign), so there is no ARN to accept (DG-063 D-35).

    Raises:
        capo_partnercentral_marketing.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action. An IAM denial carries no `Reason`. A refusal for the caller's Partner Central state carries one, so a client tells the two apart by its presence.
        capo_partnercentral_marketing.errors.internal_server_exception.InternalServerException: An unexpected error occurred during the processing of the request.
        capo_partnercentral_marketing.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_partnercentral_marketing.errors.validation_exception.ValidationException: The input fails to satisfy the constraints specified by the service. A caller branches on `Reason`, and where the rejection is attributable to particular fields it reads `FieldList` rather than parsing `Message`, which is prose and may change.
        capo_partnercentral_marketing.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
        capo_partnercentral_marketing.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_marketing.types.get_campaign_asset_export_task_request.GetCampaignAssetExportTaskRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_marketing.types.get_campaign_asset_export_task_response.GetCampaignAssetExportTaskResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.get_campaign_asset_export_task

        output, http_response = (
            capo_partnercentral_marketing._operations.aws_partner_demand_generator.get_campaign_asset_export_task.get_campaign_asset_export_task(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCampaignAssetExportTask")
    )
    input_: capo_partnercentral_marketing.types.get_campaign_asset_export_task_request.GetCampaignAssetExportTaskRequest = {
        "catalog": catalog,
        "campaign_identifier": campaign_identifier,
        "campaign_asset_export_task_identifier": campaign_asset_export_task_identifier,
    }

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