Skip to content

search_campaign_templates async

search_campaign_templates(
    catalog: Catalog,
    *,
    config_overrides: Optional[AsyncPartnerCentralMarketingClientConfig] = None,
    search_text: Optional[TemplateSearchText] = None,
    industry: Optional[IndustryFilterList] = None,
    use_case: Optional[UseCaseFilterList] = None,
    language: Optional[LanguageFilterList] = None,
    aws_services: Optional[AwsServiceFilterList] = None,
    customer_segments: Optional[CustomerSegmentFilterList] = None,
    themes: Optional[ThemeFilterList] = None,
    collection: Optional[CampaignTemplateCollectionFilterList] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> SearchCampaignTemplatesResponse

Searches and browses the AWS-authored campaign template catalog. With no SearchText it returns the whole catalog in the default order, so browse and keyword search share one shape; GetCampaignTemplate reads one template.

Parameters:

  • catalog (Catalog) –

    The catalog (AWS or Sandbox). AWS and Sandbox templates may differ.

  • search_text (Optional[TemplateSearchText], default: None ) –

    Free-text query matched against the template's name and description. Any word may match, and the last word matches as a prefix when it has 3 or more characters, so nov finds Amazon Nova. A template whose name holds the query as a phrase ranks first, then whole-word matches, then prefix-only ones. Omit to browse the whole catalog. Text analysis is derived from each template's own LanguageCode, never from the language filter.

  • industry (Optional[IndustryFilterList], default: None ) –

    Restrict to templates in these industries. Values within this member are OR-ed; distinct facet members are AND-ed. Exact, case-sensitive match.

  • use_case (Optional[UseCaseFilterList], default: None ) –

    Restrict to templates with these campaign use cases. Values within this member are OR-ed; distinct facet members are AND-ed. Exact, case-sensitive match.

  • language (Optional[LanguageFilterList], default: None ) –

    Restrict to templates in these language(s), matched by each template's LanguageCode. Values within this member are OR-ed; distinct facet members are AND-ed. Narrows results; it does not reinterpret SearchText.

  • aws_services (Optional[AwsServiceFilterList], default: None ) –

    Restrict to templates promoting these AWS services. Values within this member are OR-ed; distinct facet members are AND-ed. Exact, case-sensitive match.

  • customer_segments (Optional[CustomerSegmentFilterList], default: None ) –

    Restrict to templates for these customer segments. Values within this member are OR-ed; distinct facet members are AND-ed. A template that names no customer segment matches every value.

  • themes (Optional[ThemeFilterList], default: None ) –

    Restrict to templates with these themes. Values within this member are OR-ed; distinct facet members are AND-ed. A template that names no theme matches every value.

  • collection (Optional[CampaignTemplateCollectionFilterList], default: None ) –

    Restrict to templates in these collections. Values within this member are OR-ed; distinct facet members are AND-ed. Omit for no restriction; there is no default.

  • max_results (Optional[MaxResults], default: None ) –

    Maximum results per page.

  • next_token (Optional[NextToken], default: None ) –

    Pagination token.

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.

  • UnknownServiceError –

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

Examples:

Browse the whole catalog

>>> await client.search_campaign_templates(catalog='AWS')
Search with a facet filter
>>> await client.search_campaign_templates(catalog='AWS', search_text='contact center', industry=['TELECOMMUNICATIONS'])
Browse the Build with AI collection in one language
>>> await client.search_campaign_templates(catalog='AWS', collection=['BUILD_WITH_AI'], language=['ja'])
Source code in docs_src/capo_partnercentral_marketing/_services/async_partner_central_marketing.py
async def search_campaign_templates(
    self,
    catalog: "capo_partnercentral_marketing.types.catalog.Catalog",
    *,
    config_overrides: Optional[AsyncPartnerCentralMarketingClientConfig] = None,
    search_text: Optional[
        "capo_partnercentral_marketing.types.template_search_text.TemplateSearchText"
    ] = None,
    industry: Optional[
        "capo_partnercentral_marketing.types.industry_filter_list.IndustryFilterList"
    ] = None,
    use_case: Optional[
        "capo_partnercentral_marketing.types.use_case_filter_list.UseCaseFilterList"
    ] = None,
    language: Optional[
        "capo_partnercentral_marketing.types.language_filter_list.LanguageFilterList"
    ] = None,
    aws_services: Optional[
        "capo_partnercentral_marketing.types.aws_service_filter_list.AwsServiceFilterList"
    ] = None,
    customer_segments: Optional[
        "capo_partnercentral_marketing.types.customer_segment_filter_list.CustomerSegmentFilterList"
    ] = None,
    themes: Optional[
        "capo_partnercentral_marketing.types.theme_filter_list.ThemeFilterList"
    ] = None,
    collection: Optional[
        "capo_partnercentral_marketing.types.campaign_template_collection_filter_list.CampaignTemplateCollectionFilterList"
    ] = None,
    max_results: Optional[
        "capo_partnercentral_marketing.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_partnercentral_marketing.types.next_token.NextToken"
    ] = None,
) -> "capo_partnercentral_marketing.types.search_campaign_templates_response.SearchCampaignTemplatesResponse":
    """Searches and browses the AWS-authored campaign template catalog. With no SearchText it returns the whole catalog in the default order, so browse and keyword search share one shape; GetCampaignTemplate reads one template.

    Args:
        catalog: The catalog (AWS or Sandbox). AWS and Sandbox templates may differ.
        search_text: Free-text query matched against the template's name and description. Any word may match, and the last word matches as a prefix when it has 3 or more characters, so `nov` finds Amazon Nova. A template whose name holds the query as a phrase ranks first, then whole-word matches, then prefix-only ones. Omit to browse the whole catalog. Text analysis is derived from each template's own LanguageCode, never from the language filter.
        industry: Restrict to templates in these industries. Values within this member are OR-ed; distinct facet members are AND-ed. Exact, case-sensitive match.
        use_case: Restrict to templates with these campaign use cases. Values within this member are OR-ed; distinct facet members are AND-ed. Exact, case-sensitive match.
        language: Restrict to templates in these language(s), matched by each template's `LanguageCode`. Values within this member are OR-ed; distinct facet members are AND-ed. Narrows results; it does not reinterpret SearchText.
        aws_services: Restrict to templates promoting these AWS services. Values within this member are OR-ed; distinct facet members are AND-ed. Exact, case-sensitive match.
        customer_segments: Restrict to templates for these customer segments. Values within this member are OR-ed; distinct facet members are AND-ed. A template that names no customer segment matches every value.
        themes: Restrict to templates with these themes. Values within this member are OR-ed; distinct facet members are AND-ed. A template that names no theme matches every value.
        collection: Restrict to templates in these collections. Values within this member are OR-ed; distinct facet members are AND-ed. Omit for no restriction; there is no default.
        max_results: Maximum results per page.
        next_token: Pagination token.

    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.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Browse the whole catalog

        >>> await client.search_campaign_templates(catalog='AWS')
        Search with a facet filter

        >>> await client.search_campaign_templates(catalog='AWS', search_text='contact center', industry=['TELECOMMUNICATIONS'])
        Browse the Build with AI collection in one language

        >>> await client.search_campaign_templates(catalog='AWS', collection=['BUILD_WITH_AI'], language=['ja'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_partnercentral_marketing.types.search_campaign_templates_request.SearchCampaignTemplatesRequest]",
    ) -> AsyncOperationResponse[
        "capo_partnercentral_marketing.types.search_campaign_templates_response.SearchCampaignTemplatesResponse"
    ]:
        import capo_partnercentral_marketing._operations.aws_partner_demand_generator.search_campaign_templates

        (
            output,
            http_response,
        ) = await capo_partnercentral_marketing._operations.aws_partner_demand_generator.search_campaign_templates.async_search_campaign_templates(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchCampaignTemplates")
    )
    input_: capo_partnercentral_marketing.types.search_campaign_templates_request.SearchCampaignTemplatesRequest = {
        "catalog": catalog
    }
    if search_text is not None:
        input_["search_text"] = search_text
    if industry is not None:
        input_["industry"] = industry
    if use_case is not None:
        input_["use_case"] = use_case
    if language is not None:
        input_["language"] = language
    if aws_services is not None:
        input_["aws_services"] = aws_services
    if customer_segments is not None:
        input_["customer_segments"] = customer_segments
    if themes is not None:
        input_["themes"] = themes
    if collection is not None:
        input_["collection"] = collection
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output