Skip to content

start_campaign_asset_export_task

start_campaign_asset_export_task(
    catalog: Catalog,
    campaign_identifier: CampaignIdentifier,
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> StartCampaignAssetExportTaskResponse

Starts an asynchronous task that packages a campaign's assets into a single downloadable ZIP archive. Fire-and-return: the campaign is validated (it must exist and not be cancelled), a task record is persisted, an asynchronous execution is started, and the task id is returned with status IN_PROGRESS. This operation does not inspect assets — all resolution, exclusion, and failure are determined by the execution and surfaced only by GetCampaignAssetExportTask. Every campaign is exportable, including one never activated, because renderable assets are composed on demand at export time rather than requiring finished, launched deliverables.

Parameters:

  • catalog (Catalog) –

    The catalog (AWS or Sandbox).

  • campaign_identifier (CampaignIdentifier) –

    The campaign whose assets are exported. Accepts the campaign id or ARN.

  • client_token (Optional[ClientToken], default: None ) –

    Idempotency token. Two requests carrying the same token within the dedup window are one request and return the same task id.

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 start_campaign_asset_export_task(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    campaign_identifier: "capo_partnercentral_marketing.types.campaign_identifier.CampaignIdentifier",
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
    client_token: Optional[
        "capo_partnercentral_marketing.types.client_token.ClientToken"
    ] = None,
) -> "capo_partnercentral_marketing.types.start_campaign_asset_export_task_response.StartCampaignAssetExportTaskResponse":
    """Starts an asynchronous task that packages a campaign's assets into a single downloadable ZIP archive. Fire-and-return: the campaign is validated (it must exist and not be cancelled), a task record is persisted, an asynchronous execution is started, and the task id is returned with status IN_PROGRESS. This operation does not inspect assets — all resolution, exclusion, and failure are determined by the execution and surfaced only by GetCampaignAssetExportTask. Every campaign is exportable, including one never activated, because renderable assets are composed on demand at export time rather than requiring finished, launched deliverables.

    Args:
        catalog: The catalog (AWS or Sandbox).
        campaign_identifier: The campaign whose assets are exported. Accepts the campaign id or ARN.
        client_token: Idempotency token. Two requests carrying the same token within the dedup window are one request and return the same task id.

    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.start_campaign_asset_export_task_request.StartCampaignAssetExportTaskRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_marketing.types.start_campaign_asset_export_task_response.StartCampaignAssetExportTaskResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.start_campaign_asset_export_task

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCampaignAssetExportTask")
    )
    input_: capo_partnercentral_marketing.types.start_campaign_asset_export_task_request.StartCampaignAssetExportTaskRequest = {
        "catalog": catalog,
        "campaign_identifier": campaign_identifier,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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