Skip to content

start_campaign_asset_activation_task

start_campaign_asset_activation_task(
    catalog: Catalog,
    campaign_identifier: CampaignIdentifier,
    campaign_asset_identifiers: CampaignAssetIdentifiers,
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> StartCampaignAssetActivationTaskResponse

Activates 1–25 of a campaign's assets as one ordered unit, and returns a task to poll. Takes a list because the service owns the ordering. Assets link to one another by URL — an email's call-to-action carries the landing page's URL, the landing page's download field carries the document's — and a URL does not exist until the asset it points at is activated. Those edges are derived by the service from the campaign's pinned template, so reconstructing and topologically sorting them is work the service has already done, and getting it wrong arms an email with a dead link. Name every asset you want live and the service sequences them; "activate everything" is the list with every id in it, which ListCampaignAssets already gave you. Asynchronous, because activating an asset installs or arms behaviour that runs later and an email activation bulk-loads its audience into the delivery platform. Everything decidable without a write to the delivery platform is evaluated before this returns; everything else lands on the task. A refusal that applies to one asset does not fail the request: that asset is on the task already FAILED, with its reason, and the rest run. A refusal that applies to the whole request — a malformed list, an unknown campaign, another task already running on this campaign, this service's service-linked role being deleted (ConflictException SERVICE_LINKED_ROLE_DELETION_IN_PROGRESS), a campaign setting an asset in the request needs (ValidationException CAMPAIGN_INCOMPLETE), a campaign sender that no longer passes CreateCampaign's sender rules while the request names an email (ValidationException with no FieldList, whose message ends with one Reason: <code> token per failed rule: PATTERN_MISMATCH, SENDER_DOMAIN_NOT_ALLIANCE_LEAD, or SENDER_DOMAIN_DKIM_MISSING and/or SENDER_DOMAIN_DMARC_MISSING) — is thrown, and nothing starts. One task runs on a campaign at a time. A second concurrent call is refused with ConflictException / CAMPAIGN_ACTIVATION_IN_PROGRESS, whose ResourceId names the task already holding the campaign. Two tasks over disjoint asset sets are refused too: the guard is deliberately campaign-wide, because overlapping runs made the per-asset status misleading rather than merely contended.

Parameters:

  • catalog (Catalog) –

    The catalog (AWS or Sandbox).

  • campaign_identifier (CampaignIdentifier) –

    The campaign identifier, which also authorizes the call.

  • campaign_asset_identifiers (CampaignAssetIdentifiers) –

    The assets to activate, in any order — the service derives the dependency order and ignores the order given here.

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

    Idempotency token. Two requests carrying the same token are one request, and the second returns the first one's task rather than starting a second. The deduplication window is the life of the task record, not a fixed number of hours: replaying a token after the task has expired starts a new task. Stated because a caller would otherwise assume the usual few-hour guarantee.

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.

  • ConflictException –

    The request conflicts with the current state of the resource.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • UnknownServiceError –

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

Examples:

Activate a whole campaign kit

>>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-4b81e0c9f2a7b', 'ast-9f3c1a2b7d40e', 'ast-2k7m4p9x1c6qd', 'ast-7w3n8r5t2h1ya'])
Some assets refused, the rest started anyway
>>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-4b81e0c9f2a7b', 'ast-9f3c1a2b7d40e', 'ast-2k7m4p9x1c6qd', 'ast-7w3n8r5t2h1ya'])
Every asset refused, so the task is FAILED at once
>>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-2k7m4p9x1c6qd'])
Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
def start_campaign_asset_activation_task(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    campaign_identifier: "capo_partnercentral_marketing.types.campaign_identifier.CampaignIdentifier",
    campaign_asset_identifiers: "capo_partnercentral_marketing.types.campaign_asset_identifiers.CampaignAssetIdentifiers",
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
    client_token: Optional[
        "capo_partnercentral_marketing.types.client_token.ClientToken"
    ] = None,
) -> "capo_partnercentral_marketing.types.start_campaign_asset_activation_task_response.StartCampaignAssetActivationTaskResponse":
    """Activates 1–25 of a campaign's assets as one ordered unit, and returns a task to poll. Takes a **list** because the service owns the ordering. Assets link to one another by URL — an email's call-to-action carries the landing page's URL, the landing page's download field carries the document's — and a URL does not exist until the asset it points at is activated. Those edges are derived by the service from the campaign's pinned template, so reconstructing and topologically sorting them is work the service has already done, and getting it wrong arms an email with a dead link. Name every asset you want live and the service sequences them; "activate everything" is the list with every id in it, which ListCampaignAssets already gave you. Asynchronous, because activating an asset installs or arms behaviour that runs later and an email activation bulk-loads its audience into the delivery platform. Everything decidable **without** a write to the delivery platform is evaluated before this returns; everything else lands on the task. A refusal that applies to one asset does not fail the request: that asset is on the task already FAILED, with its reason, and the rest run. A refusal that applies to the whole request — a malformed list, an unknown campaign, another task already running on this campaign, this service's service-linked role being deleted (ConflictException `SERVICE_LINKED_ROLE_DELETION_IN_PROGRESS`), a campaign setting an asset in the request needs (ValidationException `CAMPAIGN_INCOMPLETE`), a campaign sender that no longer passes `CreateCampaign`'s sender rules while the request names an email (ValidationException with no `FieldList`, whose message ends with one `Reason: <code>` token per failed rule: `PATTERN_MISMATCH`, `SENDER_DOMAIN_NOT_ALLIANCE_LEAD`, or `SENDER_DOMAIN_DKIM_MISSING` and/or `SENDER_DOMAIN_DMARC_MISSING`) — is thrown, and nothing starts. One task runs on a campaign at a time. A second concurrent call is refused with ConflictException / CAMPAIGN_ACTIVATION_IN_PROGRESS, whose `ResourceId` names the task already holding the campaign. Two tasks over *disjoint* asset sets are refused too: the guard is deliberately campaign-wide, because overlapping runs made the per-asset status misleading rather than merely contended.

    Args:
        catalog: The catalog (AWS or Sandbox).
        campaign_identifier: The campaign identifier, which also authorizes the call.
        campaign_asset_identifiers: The assets to activate, in any order — the service derives the dependency order and ignores the order given here.
        client_token: Idempotency token. Two requests carrying the same token are one request, and the second returns the first one's task rather than starting a second. The deduplication window is the **life of the task record**, not a fixed number of hours: replaying a token after the task has expired starts a new task. Stated because a caller would otherwise assume the usual few-hour guarantee.

    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.conflict_exception.ConflictException: The request conflicts with the current state of the resource.
        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.

    Examples:
        Activate a whole campaign kit

        >>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-4b81e0c9f2a7b', 'ast-9f3c1a2b7d40e', 'ast-2k7m4p9x1c6qd', 'ast-7w3n8r5t2h1ya'])
        Some assets refused, the rest started anyway

        >>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-4b81e0c9f2a7b', 'ast-9f3c1a2b7d40e', 'ast-2k7m4p9x1c6qd', 'ast-7w3n8r5t2h1ya'])
        Every asset refused, so the task is FAILED at once

        >>> client.start_campaign_asset_activation_task(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', campaign_asset_identifiers=['ast-2k7m4p9x1c6qd'])
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_marketing.types.start_campaign_asset_activation_task_request.StartCampaignAssetActivationTaskRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_marketing.types.start_campaign_asset_activation_task_response.StartCampaignAssetActivationTaskResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.start_campaign_asset_activation_task

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCampaignAssetActivationTask")
    )
    input_: capo_partnercentral_marketing.types.start_campaign_asset_activation_task_request.StartCampaignAssetActivationTaskRequest = {
        "catalog": catalog,
        "campaign_identifier": campaign_identifier,
        "campaign_asset_identifiers": campaign_asset_identifiers,
    }
    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