Skip to content

batch_create_campaign_asset

batch_create_campaign_asset(
    catalog: Catalog,
    campaign_identifier: CampaignIdentifier,
    entries: BatchCreateCampaignAssetEntries,
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> BatchCreateCampaignAssetResponse

Instantiates one or more of the campaign template's blueprints as assets of this campaign. The only asset-create operation: DG-038 deleted the singular CreateCampaignAsset, and AWS Batch Operations makes exposing a singular alongside a batch optional ("which MAY actually be exposed in addition"). It also replaced kit instantiation -- CreateCampaign creates zero assets, so this is the only path by which an asset comes into existence. Errors here are whole-request only, and nothing is written when one is thrown. Per-entry failures ride in the response's Errors list with a 200. ServiceQuotaExceededException is deliberately absent: a campaign holds at most one asset per blueprint (I-15), so the ceiling is the size of the bound kit and a request of unique valid entries cannot exceed it.

Parameters:

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:

Instantiate two of the kit's blueprints

>>> client.batch_create_campaign_asset(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', entries=[{'SourceAssetTemplateIdentifier': 'ta000000email'}, {'SourceAssetTemplateIdentifier': 'ta0000000lp01'}])
A partial batch: one entry names a blueprint the campaign's template does not carry
>>> client.batch_create_campaign_asset(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', entries=[{'SourceAssetTemplateIdentifier': 'ta000000email'}, {'SourceAssetTemplateIdentifier': 'ta00000absent'}])
Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
def batch_create_campaign_asset(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    campaign_identifier: "capo_partnercentral_marketing.types.campaign_identifier.CampaignIdentifier",
    entries: "capo_partnercentral_marketing.types.batch_create_campaign_asset_entries.BatchCreateCampaignAssetEntries",
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> "capo_partnercentral_marketing.types.batch_create_campaign_asset_response.BatchCreateCampaignAssetResponse":
    """Instantiates one or more of the campaign template's blueprints as assets of this campaign. The only asset-create operation: DG-038 deleted the singular CreateCampaignAsset, and AWS Batch Operations makes exposing a singular alongside a batch optional ("which MAY actually be exposed in addition"). It also replaced kit instantiation -- CreateCampaign creates zero assets, so this is the only path by which an asset comes into existence. Errors here are whole-request only, and nothing is written when one is thrown. Per-entry failures ride in the response's `Errors` list with a 200. ServiceQuotaExceededException is deliberately absent: a campaign holds at most one asset per blueprint (I-15), so the ceiling is the size of the bound kit and a request of unique valid entries cannot exceed it.

    Args:
        catalog: The catalog (AWS or Sandbox).
        campaign_identifier: The campaign identifier.
        entries: The blueprints to instantiate, one entry each.

    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:
        Instantiate two of the kit's blueprints

        >>> client.batch_create_campaign_asset(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', entries=[{'SourceAssetTemplateIdentifier': 'ta000000email'}, {'SourceAssetTemplateIdentifier': 'ta0000000lp01'}])
        A partial batch: one entry names a blueprint the campaign's template does not carry

        >>> client.batch_create_campaign_asset(catalog='AWS', campaign_identifier='camp-5Hq2m8x4k1p9w', entries=[{'SourceAssetTemplateIdentifier': 'ta000000email'}, {'SourceAssetTemplateIdentifier': 'ta00000absent'}])
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_marketing.types.batch_create_campaign_asset_request.BatchCreateCampaignAssetRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_marketing.types.batch_create_campaign_asset_response.BatchCreateCampaignAssetResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.batch_create_campaign_asset

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchCreateCampaignAsset")
    )
    input_: capo_partnercentral_marketing.types.batch_create_campaign_asset_request.BatchCreateCampaignAssetRequest = {
        "catalog": catalog,
        "campaign_identifier": campaign_identifier,
        "entries": entries,
    }

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