Skip to content

get_campaign_template

get_campaign_template(
    catalog: Catalog,
    identifier: CampaignTemplateId,
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> GetCampaignTemplateResponse

Retrieves full detail of one campaign template, including its ordered asset templates with their field schema and layout previews.

Parameters:

  • catalog (Catalog) –

    The catalog (AWS or Sandbox).

  • identifier (CampaignTemplateId) –

    The campaign template's id. A campaign template has no ARN (DG-084).

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.

Examples:

Get a campaign template

>>> client.get_campaign_template(catalog='AWS', identifier='tmpl-987xyz654abcd')
Source code in docs_src/capo_partnercentral_marketing/_services/partner_central_marketing.py
def get_campaign_template(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    identifier: "capo_partnercentral_marketing.types.campaign_template_id.CampaignTemplateId",
    *,
    config_overrides: Optional[PartnerCentralMarketingClientConfig] = None,
) -> "capo_partnercentral_marketing.types.get_campaign_template_response.GetCampaignTemplateResponse":
    """Retrieves full detail of one campaign template, including its ordered asset templates with their field schema and layout previews.

    Args:
        catalog: The catalog (AWS or Sandbox).
        identifier: The campaign template's id. A campaign template has no ARN (DG-084).

    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.

    Examples:
        Get a campaign template

        >>> client.get_campaign_template(catalog='AWS', identifier='tmpl-987xyz654abcd')
    """

    def _handler(
        req: "OperationRequest[capo_partnercentral_marketing.types.get_campaign_template_request.GetCampaignTemplateRequest]",
    ) -> OperationResponse[
        "capo_partnercentral_marketing.types.get_campaign_template_response.GetCampaignTemplateResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.get_campaign_template

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

    def _redact_output(
        output: "capo_partnercentral_marketing.types.get_campaign_template_response.GetCampaignTemplateResponse",
    ) -> dict[str, Any]:
        import capo_partnercentral_marketing.types.get_campaign_template_response

        return capo_partnercentral_marketing.types.get_campaign_template_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetCampaignTemplate", redact_output=_redact_output),
    )
    input_: capo_partnercentral_marketing.types.get_campaign_template_request.GetCampaignTemplateRequest = {
        "catalog": catalog,
        "identifier": identifier,
    }

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