Class RuleAction

java.lang.Object
software.amazon.awssdk.services.mailmanager.model.RuleAction
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<RuleAction.Builder,RuleAction>

@Generated("software.amazon.awssdk:codegen") public final class RuleAction extends Object implements SdkPojo, Serializable, ToCopyableBuilder<RuleAction.Builder,RuleAction>

The action for a rule to take. Only one of the contained actions can be set.

See Also:
  • Method Details

    • addHeader

      public final AddHeaderAction addHeader()

      This action adds a header. This can be used to add arbitrary email headers.

      Returns:
      This action adds a header. This can be used to add arbitrary email headers.
    • archive

      public final ArchiveAction archive()

      This action archives the email. This can be used to deliver an email to an archive.

      Returns:
      This action archives the email. This can be used to deliver an email to an archive.
    • deliverToMailbox

      public final DeliverToMailboxAction deliverToMailbox()

      This action delivers an email to a WorkMail mailbox.

      Returns:
      This action delivers an email to a WorkMail mailbox.
    • deliverToQBusiness

      public final DeliverToQBusinessAction deliverToQBusiness()

      This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.

      Returns:
      This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.
    • drop

      public final DropAction drop()

      This action terminates the evaluation of rules in the rule set.

      Returns:
      This action terminates the evaluation of rules in the rule set.
    • publishToSns

      public final SnsAction publishToSns()

      This action publishes the email content to an Amazon SNS topic.

      Returns:
      This action publishes the email content to an Amazon SNS topic.
    • relay

      public final RelayAction relay()

      This action relays the email to another SMTP server.

      Returns:
      This action relays the email to another SMTP server.
    • replaceRecipient

      public final ReplaceRecipientAction replaceRecipient()

      The action replaces certain or all recipients with a different set of recipients.

      Returns:
      The action replaces certain or all recipients with a different set of recipients.
    • send

      public final SendAction send()

      This action sends the email to the internet.

      Returns:
      This action sends the email to the internet.
    • writeToS3

      public final S3Action writeToS3()

      This action writes the MIME content of the email to an S3 bucket.

      Returns:
      This action writes the MIME content of the email to an S3 bucket.
    • toBuilder

      public RuleAction.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<RuleAction.Builder,RuleAction>
      Returns:
      a builder for type T
    • builder

      public static RuleAction.Builder builder()
    • serializableBuilderClass

      public static Class<? extends RuleAction.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • fromAddHeader

      public static RuleAction fromAddHeader(AddHeaderAction addHeader)
      Create an instance of this class with addHeader() initialized to the given value.

      This action adds a header. This can be used to add arbitrary email headers.

      Parameters:
      addHeader - This action adds a header. This can be used to add arbitrary email headers.
    • fromAddHeader

      public static RuleAction fromAddHeader(Consumer<AddHeaderAction.Builder> addHeader)
      Create an instance of this class with addHeader() initialized to the given value.

      This action adds a header. This can be used to add arbitrary email headers.

      Parameters:
      addHeader - This action adds a header. This can be used to add arbitrary email headers.
    • fromArchive

      public static RuleAction fromArchive(ArchiveAction archive)
      Create an instance of this class with archive() initialized to the given value.

      This action archives the email. This can be used to deliver an email to an archive.

      Parameters:
      archive - This action archives the email. This can be used to deliver an email to an archive.
    • fromArchive

      public static RuleAction fromArchive(Consumer<ArchiveAction.Builder> archive)
      Create an instance of this class with archive() initialized to the given value.

      This action archives the email. This can be used to deliver an email to an archive.

      Parameters:
      archive - This action archives the email. This can be used to deliver an email to an archive.
    • fromDeliverToMailbox

      public static RuleAction fromDeliverToMailbox(DeliverToMailboxAction deliverToMailbox)
      Create an instance of this class with deliverToMailbox() initialized to the given value.

      This action delivers an email to a WorkMail mailbox.

      Parameters:
      deliverToMailbox - This action delivers an email to a WorkMail mailbox.
    • fromDeliverToMailbox

      public static RuleAction fromDeliverToMailbox(Consumer<DeliverToMailboxAction.Builder> deliverToMailbox)
      Create an instance of this class with deliverToMailbox() initialized to the given value.

      This action delivers an email to a WorkMail mailbox.

      Parameters:
      deliverToMailbox - This action delivers an email to a WorkMail mailbox.
    • fromDeliverToQBusiness

      public static RuleAction fromDeliverToQBusiness(DeliverToQBusinessAction deliverToQBusiness)
      Create an instance of this class with deliverToQBusiness() initialized to the given value.

      This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.

      Parameters:
      deliverToQBusiness - This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.
    • fromDeliverToQBusiness

      public static RuleAction fromDeliverToQBusiness(Consumer<DeliverToQBusinessAction.Builder> deliverToQBusiness)
      Create an instance of this class with deliverToQBusiness() initialized to the given value.

      This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.

      Parameters:
      deliverToQBusiness - This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.
    • fromDrop

      public static RuleAction fromDrop(DropAction drop)
      Create an instance of this class with drop() initialized to the given value.

      This action terminates the evaluation of rules in the rule set.

      Parameters:
      drop - This action terminates the evaluation of rules in the rule set.
    • fromDrop

      public static RuleAction fromDrop(Consumer<DropAction.Builder> drop)
      Create an instance of this class with drop() initialized to the given value.

      This action terminates the evaluation of rules in the rule set.

      Parameters:
      drop - This action terminates the evaluation of rules in the rule set.
    • fromPublishToSns

      public static RuleAction fromPublishToSns(SnsAction publishToSns)
      Create an instance of this class with publishToSns() initialized to the given value.

      This action publishes the email content to an Amazon SNS topic.

      Parameters:
      publishToSns - This action publishes the email content to an Amazon SNS topic.
    • fromPublishToSns

      public static RuleAction fromPublishToSns(Consumer<SnsAction.Builder> publishToSns)
      Create an instance of this class with publishToSns() initialized to the given value.

      This action publishes the email content to an Amazon SNS topic.

      Parameters:
      publishToSns - This action publishes the email content to an Amazon SNS topic.
    • fromRelay

      public static RuleAction fromRelay(RelayAction relay)
      Create an instance of this class with relay() initialized to the given value.

      This action relays the email to another SMTP server.

      Parameters:
      relay - This action relays the email to another SMTP server.
    • fromRelay

      public static RuleAction fromRelay(Consumer<RelayAction.Builder> relay)
      Create an instance of this class with relay() initialized to the given value.

      This action relays the email to another SMTP server.

      Parameters:
      relay - This action relays the email to another SMTP server.
    • fromReplaceRecipient

      public static RuleAction fromReplaceRecipient(ReplaceRecipientAction replaceRecipient)
      Create an instance of this class with replaceRecipient() initialized to the given value.

      The action replaces certain or all recipients with a different set of recipients.

      Parameters:
      replaceRecipient - The action replaces certain or all recipients with a different set of recipients.
    • fromReplaceRecipient

      public static RuleAction fromReplaceRecipient(Consumer<ReplaceRecipientAction.Builder> replaceRecipient)
      Create an instance of this class with replaceRecipient() initialized to the given value.

      The action replaces certain or all recipients with a different set of recipients.

      Parameters:
      replaceRecipient - The action replaces certain or all recipients with a different set of recipients.
    • fromSend

      public static RuleAction fromSend(SendAction send)
      Create an instance of this class with send() initialized to the given value.

      This action sends the email to the internet.

      Parameters:
      send - This action sends the email to the internet.
    • fromSend

      public static RuleAction fromSend(Consumer<SendAction.Builder> send)
      Create an instance of this class with send() initialized to the given value.

      This action sends the email to the internet.

      Parameters:
      send - This action sends the email to the internet.
    • fromWriteToS3

      public static RuleAction fromWriteToS3(S3Action writeToS3)
      Create an instance of this class with writeToS3() initialized to the given value.

      This action writes the MIME content of the email to an S3 bucket.

      Parameters:
      writeToS3 - This action writes the MIME content of the email to an S3 bucket.
    • fromWriteToS3

      public static RuleAction fromWriteToS3(Consumer<S3Action.Builder> writeToS3)
      Create an instance of this class with writeToS3() initialized to the given value.

      This action writes the MIME content of the email to an S3 bucket.

      Parameters:
      writeToS3 - This action writes the MIME content of the email to an S3 bucket.
    • type

      public RuleAction.Type type()
      Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will be RuleAction.Type.UNKNOWN_TO_SDK_VERSION if the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will be RuleAction.Type.UNKNOWN_TO_SDK_VERSION if zero members are set, and null if more than one member is set.
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.