Class CfnCampaign

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:56:02.475Z") @Stability(Stable) public class CfnCampaign extends CfnResource implements IInspectable, ITaggable
Specifies the settings for a campaign.

A campaign is a messaging initiative that engages a specific segment of users for an Amazon Pinpoint application.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.pinpoint.*;
 Object attributes;
 Object customConfig;
 Object metrics;
 Object tags;
 CfnCampaign cfnCampaign = CfnCampaign.Builder.create(this, "MyCfnCampaign")
         .applicationId("applicationId")
         .name("name")
         .schedule(ScheduleProperty.builder()
                 .endTime("endTime")
                 .eventFilter(CampaignEventFilterProperty.builder()
                         .dimensions(EventDimensionsProperty.builder()
                                 .attributes(attributes)
                                 .eventType(SetDimensionProperty.builder()
                                         .dimensionType("dimensionType")
                                         .values(List.of("values"))
                                         .build())
                                 .metrics(metrics)
                                 .build())
                         .filterType("filterType")
                         .build())
                 .frequency("frequency")
                 .isLocalTime(false)
                 .quietTime(QuietTimeProperty.builder()
                         .end("end")
                         .start("start")
                         .build())
                 .startTime("startTime")
                 .timeZone("timeZone")
                 .build())
         .segmentId("segmentId")
         // the properties below are optional
         .additionalTreatments(List.of(WriteTreatmentResourceProperty.builder()
                 .customDeliveryConfiguration(CustomDeliveryConfigurationProperty.builder()
                         .deliveryUri("deliveryUri")
                         .endpointTypes(List.of("endpointTypes"))
                         .build())
                 .messageConfiguration(MessageConfigurationProperty.builder()
                         .admMessage(MessageProperty.builder()
                                 .action("action")
                                 .body("body")
                                 .imageIconUrl("imageIconUrl")
                                 .imageSmallIconUrl("imageSmallIconUrl")
                                 .imageUrl("imageUrl")
                                 .jsonBody("jsonBody")
                                 .mediaUrl("mediaUrl")
                                 .rawContent("rawContent")
                                 .silentPush(false)
                                 .timeToLive(123)
                                 .title("title")
                                 .url("url")
                                 .build())
                         .apnsMessage(MessageProperty.builder()
                                 .action("action")
                                 .body("body")
                                 .imageIconUrl("imageIconUrl")
                                 .imageSmallIconUrl("imageSmallIconUrl")
                                 .imageUrl("imageUrl")
                                 .jsonBody("jsonBody")
                                 .mediaUrl("mediaUrl")
                                 .rawContent("rawContent")
                                 .silentPush(false)
                                 .timeToLive(123)
                                 .title("title")
                                 .url("url")
                                 .build())
                         .baiduMessage(MessageProperty.builder()
                                 .action("action")
                                 .body("body")
                                 .imageIconUrl("imageIconUrl")
                                 .imageSmallIconUrl("imageSmallIconUrl")
                                 .imageUrl("imageUrl")
                                 .jsonBody("jsonBody")
                                 .mediaUrl("mediaUrl")
                                 .rawContent("rawContent")
                                 .silentPush(false)
                                 .timeToLive(123)
                                 .title("title")
                                 .url("url")
                                 .build())
                         .customMessage(CampaignCustomMessageProperty.builder()
                                 .data("data")
                                 .build())
                         .defaultMessage(MessageProperty.builder()
                                 .action("action")
                                 .body("body")
                                 .imageIconUrl("imageIconUrl")
                                 .imageSmallIconUrl("imageSmallIconUrl")
                                 .imageUrl("imageUrl")
                                 .jsonBody("jsonBody")
                                 .mediaUrl("mediaUrl")
                                 .rawContent("rawContent")
                                 .silentPush(false)
                                 .timeToLive(123)
                                 .title("title")
                                 .url("url")
                                 .build())
                         .emailMessage(CampaignEmailMessageProperty.builder()
                                 .body("body")
                                 .fromAddress("fromAddress")
                                 .htmlBody("htmlBody")
                                 .title("title")
                                 .build())
                         .gcmMessage(MessageProperty.builder()
                                 .action("action")
                                 .body("body")
                                 .imageIconUrl("imageIconUrl")
                                 .imageSmallIconUrl("imageSmallIconUrl")
                                 .imageUrl("imageUrl")
                                 .jsonBody("jsonBody")
                                 .mediaUrl("mediaUrl")
                                 .rawContent("rawContent")
                                 .silentPush(false)
                                 .timeToLive(123)
                                 .title("title")
                                 .url("url")
                                 .build())
                         .inAppMessage(CampaignInAppMessageProperty.builder()
                                 .content(List.of(InAppMessageContentProperty.builder()
                                         .backgroundColor("backgroundColor")
                                         .bodyConfig(InAppMessageBodyConfigProperty.builder()
                                                 .alignment("alignment")
                                                 .body("body")
                                                 .textColor("textColor")
                                                 .build())
                                         .headerConfig(InAppMessageHeaderConfigProperty.builder()
                                                 .alignment("alignment")
                                                 .header("header")
                                                 .textColor("textColor")
                                                 .build())
                                         .imageUrl("imageUrl")
                                         .primaryBtn(InAppMessageButtonProperty.builder()
                                                 .android(OverrideButtonConfigurationProperty.builder()
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .build())
                                                 .defaultConfig(DefaultButtonConfigurationProperty.builder()
                                                         .backgroundColor("backgroundColor")
                                                         .borderRadius(123)
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .text("text")
                                                         .textColor("textColor")
                                                         .build())
                                                 .ios(OverrideButtonConfigurationProperty.builder()
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .build())
                                                 .web(OverrideButtonConfigurationProperty.builder()
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .build())
                                                 .build())
                                         .secondaryBtn(InAppMessageButtonProperty.builder()
                                                 .android(OverrideButtonConfigurationProperty.builder()
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .build())
                                                 .defaultConfig(DefaultButtonConfigurationProperty.builder()
                                                         .backgroundColor("backgroundColor")
                                                         .borderRadius(123)
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .text("text")
                                                         .textColor("textColor")
                                                         .build())
                                                 .ios(OverrideButtonConfigurationProperty.builder()
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .build())
                                                 .web(OverrideButtonConfigurationProperty.builder()
                                                         .buttonAction("buttonAction")
                                                         .link("link")
                                                         .build())
                                                 .build())
                                         .build()))
                                 .customConfig(customConfig)
                                 .layout("layout")
                                 .build())
                         .smsMessage(CampaignSmsMessageProperty.builder()
                                 .body("body")
                                 .entityId("entityId")
                                 .messageType("messageType")
                                 .originationNumber("originationNumber")
                                 .senderId("senderId")
                                 .templateId("templateId")
                                 .build())
                         .build())
                 .schedule(ScheduleProperty.builder()
                         .endTime("endTime")
                         .eventFilter(CampaignEventFilterProperty.builder()
                                 .dimensions(EventDimensionsProperty.builder()
                                         .attributes(attributes)
                                         .eventType(SetDimensionProperty.builder()
                                                 .dimensionType("dimensionType")
                                                 .values(List.of("values"))
                                                 .build())
                                         .metrics(metrics)
                                         .build())
                                 .filterType("filterType")
                                 .build())
                         .frequency("frequency")
                         .isLocalTime(false)
                         .quietTime(QuietTimeProperty.builder()
                                 .end("end")
                                 .start("start")
                                 .build())
                         .startTime("startTime")
                         .timeZone("timeZone")
                         .build())
                 .sizePercent(123)
                 .templateConfiguration(TemplateConfigurationProperty.builder()
                         .emailTemplate(TemplateProperty.builder()
                                 .name("name")
                                 .version("version")
                                 .build())
                         .pushTemplate(TemplateProperty.builder()
                                 .name("name")
                                 .version("version")
                                 .build())
                         .smsTemplate(TemplateProperty.builder()
                                 .name("name")
                                 .version("version")
                                 .build())
                         .voiceTemplate(TemplateProperty.builder()
                                 .name("name")
                                 .version("version")
                                 .build())
                         .build())
                 .treatmentDescription("treatmentDescription")
                 .treatmentName("treatmentName")
                 .build()))
         .campaignHook(CampaignHookProperty.builder()
                 .lambdaFunctionName("lambdaFunctionName")
                 .mode("mode")
                 .webUrl("webUrl")
                 .build())
         .customDeliveryConfiguration(CustomDeliveryConfigurationProperty.builder()
                 .deliveryUri("deliveryUri")
                 .endpointTypes(List.of("endpointTypes"))
                 .build())
         .description("description")
         .holdoutPercent(123)
         .isPaused(false)
         .limits(LimitsProperty.builder()
                 .daily(123)
                 .maximumDuration(123)
                 .messagesPerSecond(123)
                 .session(123)
                 .total(123)
                 .build())
         .messageConfiguration(MessageConfigurationProperty.builder()
                 .admMessage(MessageProperty.builder()
                         .action("action")
                         .body("body")
                         .imageIconUrl("imageIconUrl")
                         .imageSmallIconUrl("imageSmallIconUrl")
                         .imageUrl("imageUrl")
                         .jsonBody("jsonBody")
                         .mediaUrl("mediaUrl")
                         .rawContent("rawContent")
                         .silentPush(false)
                         .timeToLive(123)
                         .title("title")
                         .url("url")
                         .build())
                 .apnsMessage(MessageProperty.builder()
                         .action("action")
                         .body("body")
                         .imageIconUrl("imageIconUrl")
                         .imageSmallIconUrl("imageSmallIconUrl")
                         .imageUrl("imageUrl")
                         .jsonBody("jsonBody")
                         .mediaUrl("mediaUrl")
                         .rawContent("rawContent")
                         .silentPush(false)
                         .timeToLive(123)
                         .title("title")
                         .url("url")
                         .build())
                 .baiduMessage(MessageProperty.builder()
                         .action("action")
                         .body("body")
                         .imageIconUrl("imageIconUrl")
                         .imageSmallIconUrl("imageSmallIconUrl")
                         .imageUrl("imageUrl")
                         .jsonBody("jsonBody")
                         .mediaUrl("mediaUrl")
                         .rawContent("rawContent")
                         .silentPush(false)
                         .timeToLive(123)
                         .title("title")
                         .url("url")
                         .build())
                 .customMessage(CampaignCustomMessageProperty.builder()
                         .data("data")
                         .build())
                 .defaultMessage(MessageProperty.builder()
                         .action("action")
                         .body("body")
                         .imageIconUrl("imageIconUrl")
                         .imageSmallIconUrl("imageSmallIconUrl")
                         .imageUrl("imageUrl")
                         .jsonBody("jsonBody")
                         .mediaUrl("mediaUrl")
                         .rawContent("rawContent")
                         .silentPush(false)
                         .timeToLive(123)
                         .title("title")
                         .url("url")
                         .build())
                 .emailMessage(CampaignEmailMessageProperty.builder()
                         .body("body")
                         .fromAddress("fromAddress")
                         .htmlBody("htmlBody")
                         .title("title")
                         .build())
                 .gcmMessage(MessageProperty.builder()
                         .action("action")
                         .body("body")
                         .imageIconUrl("imageIconUrl")
                         .imageSmallIconUrl("imageSmallIconUrl")
                         .imageUrl("imageUrl")
                         .jsonBody("jsonBody")
                         .mediaUrl("mediaUrl")
                         .rawContent("rawContent")
                         .silentPush(false)
                         .timeToLive(123)
                         .title("title")
                         .url("url")
                         .build())
                 .inAppMessage(CampaignInAppMessageProperty.builder()
                         .content(List.of(InAppMessageContentProperty.builder()
                                 .backgroundColor("backgroundColor")
                                 .bodyConfig(InAppMessageBodyConfigProperty.builder()
                                         .alignment("alignment")
                                         .body("body")
                                         .textColor("textColor")
                                         .build())
                                 .headerConfig(InAppMessageHeaderConfigProperty.builder()
                                         .alignment("alignment")
                                         .header("header")
                                         .textColor("textColor")
                                         .build())
                                 .imageUrl("imageUrl")
                                 .primaryBtn(InAppMessageButtonProperty.builder()
                                         .android(OverrideButtonConfigurationProperty.builder()
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .build())
                                         .defaultConfig(DefaultButtonConfigurationProperty.builder()
                                                 .backgroundColor("backgroundColor")
                                                 .borderRadius(123)
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .text("text")
                                                 .textColor("textColor")
                                                 .build())
                                         .ios(OverrideButtonConfigurationProperty.builder()
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .build())
                                         .web(OverrideButtonConfigurationProperty.builder()
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .build())
                                         .build())
                                 .secondaryBtn(InAppMessageButtonProperty.builder()
                                         .android(OverrideButtonConfigurationProperty.builder()
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .build())
                                         .defaultConfig(DefaultButtonConfigurationProperty.builder()
                                                 .backgroundColor("backgroundColor")
                                                 .borderRadius(123)
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .text("text")
                                                 .textColor("textColor")
                                                 .build())
                                         .ios(OverrideButtonConfigurationProperty.builder()
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .build())
                                         .web(OverrideButtonConfigurationProperty.builder()
                                                 .buttonAction("buttonAction")
                                                 .link("link")
                                                 .build())
                                         .build())
                                 .build()))
                         .customConfig(customConfig)
                         .layout("layout")
                         .build())
                 .smsMessage(CampaignSmsMessageProperty.builder()
                         .body("body")
                         .entityId("entityId")
                         .messageType("messageType")
                         .originationNumber("originationNumber")
                         .senderId("senderId")
                         .templateId("templateId")
                         .build())
                 .build())
         .priority(123)
         .segmentVersion(123)
         .tags(tags)
         .templateConfiguration(TemplateConfigurationProperty.builder()
                 .emailTemplate(TemplateProperty.builder()
                         .name("name")
                         .version("version")
                         .build())
                 .pushTemplate(TemplateProperty.builder()
                         .name("name")
                         .version("version")
                         .build())
                 .smsTemplate(TemplateProperty.builder()
                         .name("name")
                         .version("version")
                         .build())
                 .voiceTemplate(TemplateProperty.builder()
                         .name("name")
                         .version("version")
                         .build())
                 .build())
         .treatmentDescription("treatmentDescription")
         .treatmentName("treatmentName")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnCampaign

      protected CfnCampaign(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnCampaign

      protected CfnCampaign(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnCampaign

      @Stability(Stable) public CfnCampaign(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnCampaignProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The Amazon Resource Name (ARN) of the campaign.
    • getAttrCampaignId

      @Stability(Stable) @NotNull public String getAttrCampaignId()
      The unique identifier for the campaign.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getApplicationId

      @Stability(Stable) @NotNull public String getApplicationId()
      The unique identifier for the Amazon Pinpoint application that the campaign is associated with.
    • setApplicationId

      @Stability(Stable) public void setApplicationId(@NotNull String value)
      The unique identifier for the Amazon Pinpoint application that the campaign is associated with.
    • getName

      @Stability(Stable) @NotNull public String getName()
      The name of the campaign.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      The name of the campaign.
    • getSchedule

      @Stability(Stable) @NotNull public Object getSchedule()
      The schedule settings for the treatment.
    • setSchedule

      @Stability(Stable) public void setSchedule(@NotNull IResolvable value)
      The schedule settings for the treatment.
    • setSchedule

      @Stability(Stable) public void setSchedule(@NotNull CfnCampaign.ScheduleProperty value)
      The schedule settings for the treatment.
    • getSegmentId

      @Stability(Stable) @NotNull public String getSegmentId()
      The unique identifier for the segment to associate with the campaign.
    • setSegmentId

      @Stability(Stable) public void setSegmentId(@NotNull String value)
      The unique identifier for the segment to associate with the campaign.
    • getAdditionalTreatments

      @Stability(Stable) @Nullable public Object getAdditionalTreatments()
      An array of requests that defines additional treatments for the campaign, in addition to the default treatment for the campaign.
    • setAdditionalTreatments

      @Stability(Stable) public void setAdditionalTreatments(@Nullable IResolvable value)
      An array of requests that defines additional treatments for the campaign, in addition to the default treatment for the campaign.
    • setAdditionalTreatments

      @Stability(Stable) public void setAdditionalTreatments(@Nullable List<Object> value)
      An array of requests that defines additional treatments for the campaign, in addition to the default treatment for the campaign.
    • getCampaignHook

      @Stability(Stable) @Nullable public Object getCampaignHook()
      Specifies the Lambda function to use as a code hook for a campaign.
    • setCampaignHook

      @Stability(Stable) public void setCampaignHook(@Nullable IResolvable value)
      Specifies the Lambda function to use as a code hook for a campaign.
    • setCampaignHook

      @Stability(Stable) public void setCampaignHook(@Nullable CfnCampaign.CampaignHookProperty value)
      Specifies the Lambda function to use as a code hook for a campaign.
    • getCustomDeliveryConfiguration

      @Stability(Stable) @Nullable public Object getCustomDeliveryConfiguration()
      The delivery configuration settings for sending the treatment through a custom channel.
    • setCustomDeliveryConfiguration

      @Stability(Stable) public void setCustomDeliveryConfiguration(@Nullable IResolvable value)
      The delivery configuration settings for sending the treatment through a custom channel.
    • setCustomDeliveryConfiguration

      @Stability(Stable) public void setCustomDeliveryConfiguration(@Nullable CfnCampaign.CustomDeliveryConfigurationProperty value)
      The delivery configuration settings for sending the treatment through a custom channel.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A custom description of the campaign.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A custom description of the campaign.
    • getHoldoutPercent

      @Stability(Stable) @Nullable public Number getHoldoutPercent()
      The allocated percentage of users (segment members) who shouldn't receive messages from the campaign.
    • setHoldoutPercent

      @Stability(Stable) public void setHoldoutPercent(@Nullable Number value)
      The allocated percentage of users (segment members) who shouldn't receive messages from the campaign.
    • getIsPaused

      @Stability(Stable) @Nullable public Object getIsPaused()
      Specifies whether to pause the campaign.
    • setIsPaused

      @Stability(Stable) public void setIsPaused(@Nullable Boolean value)
      Specifies whether to pause the campaign.
    • setIsPaused

      @Stability(Stable) public void setIsPaused(@Nullable IResolvable value)
      Specifies whether to pause the campaign.
    • getLimits

      @Stability(Stable) @Nullable public Object getLimits()
      The messaging limits for the campaign.
    • setLimits

      @Stability(Stable) public void setLimits(@Nullable IResolvable value)
      The messaging limits for the campaign.
    • setLimits

      @Stability(Stable) public void setLimits(@Nullable CfnCampaign.LimitsProperty value)
      The messaging limits for the campaign.
    • getMessageConfiguration

      @Stability(Stable) @Nullable public Object getMessageConfiguration()
      The message configuration settings for the treatment.
    • setMessageConfiguration

      @Stability(Stable) public void setMessageConfiguration(@Nullable IResolvable value)
      The message configuration settings for the treatment.
    • setMessageConfiguration

      @Stability(Stable) public void setMessageConfiguration(@Nullable CfnCampaign.MessageConfigurationProperty value)
      The message configuration settings for the treatment.
    • getPriority

      @Stability(Stable) @Nullable public Number getPriority()
      An integer between 1 and 5, inclusive, that represents the priority of the in-app message campaign, where 1 is the highest priority and 5 is the lowest.
    • setPriority

      @Stability(Stable) public void setPriority(@Nullable Number value)
      An integer between 1 and 5, inclusive, that represents the priority of the in-app message campaign, where 1 is the highest priority and 5 is the lowest.
    • getSegmentVersion

      @Stability(Stable) @Nullable public Number getSegmentVersion()
      The version of the segment to associate with the campaign.
    • setSegmentVersion

      @Stability(Stable) public void setSegmentVersion(@Nullable Number value)
      The version of the segment to associate with the campaign.
    • getTagsRaw

      @Stability(Stable) @Nullable public Object getTagsRaw()
      An array of key-value pairs to apply to this resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Object value)
      An array of key-value pairs to apply to this resource.
    • getTemplateConfiguration

      @Stability(Stable) @Nullable public Object getTemplateConfiguration()
      The message template to use for the treatment.
    • setTemplateConfiguration

      @Stability(Stable) public void setTemplateConfiguration(@Nullable IResolvable value)
      The message template to use for the treatment.
    • setTemplateConfiguration

      @Stability(Stable) public void setTemplateConfiguration(@Nullable CfnCampaign.TemplateConfigurationProperty value)
      The message template to use for the treatment.
    • getTreatmentDescription

      @Stability(Stable) @Nullable public String getTreatmentDescription()
      A custom description of the treatment.
    • setTreatmentDescription

      @Stability(Stable) public void setTreatmentDescription(@Nullable String value)
      A custom description of the treatment.
    • getTreatmentName

      @Stability(Stable) @Nullable public String getTreatmentName()
      A custom name for the treatment.
    • setTreatmentName

      @Stability(Stable) public void setTreatmentName(@Nullable String value)
      A custom name for the treatment.