All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sesv2.model.SendBulkEmailRequest Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.sesv2.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents a request to send email messages to multiple destinations using Amazon SES. For more information, see the * Amazon SES Developer * Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SendBulkEmailRequest extends SesV2Request implements ToCopyableBuilder { private static final SdkField FROM_EMAIL_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FromEmailAddress").getter(getter(SendBulkEmailRequest::fromEmailAddress)) .setter(setter(Builder::fromEmailAddress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FromEmailAddress").build()).build(); private static final SdkField FROM_EMAIL_ADDRESS_IDENTITY_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FromEmailAddressIdentityArn") .getter(getter(SendBulkEmailRequest::fromEmailAddressIdentityArn)) .setter(setter(Builder::fromEmailAddressIdentityArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FromEmailAddressIdentityArn") .build()).build(); private static final SdkField> REPLY_TO_ADDRESSES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ReplyToAddresses") .getter(getter(SendBulkEmailRequest::replyToAddresses)) .setter(setter(Builder::replyToAddresses)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplyToAddresses").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField FEEDBACK_FORWARDING_EMAIL_ADDRESS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FeedbackForwardingEmailAddress") .getter(getter(SendBulkEmailRequest::feedbackForwardingEmailAddress)) .setter(setter(Builder::feedbackForwardingEmailAddress)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeedbackForwardingEmailAddress") .build()).build(); private static final SdkField FEEDBACK_FORWARDING_EMAIL_ADDRESS_IDENTITY_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FeedbackForwardingEmailAddressIdentityArn") .getter(getter(SendBulkEmailRequest::feedbackForwardingEmailAddressIdentityArn)) .setter(setter(Builder::feedbackForwardingEmailAddressIdentityArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("FeedbackForwardingEmailAddressIdentityArn").build()).build(); private static final SdkField> DEFAULT_EMAIL_TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DefaultEmailTags") .getter(getter(SendBulkEmailRequest::defaultEmailTags)) .setter(setter(Builder::defaultEmailTags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultEmailTags").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(MessageTag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField DEFAULT_CONTENT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DefaultContent") .getter(getter(SendBulkEmailRequest::defaultContent)).setter(setter(Builder::defaultContent)) .constructor(BulkEmailContent::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultContent").build()).build(); private static final SdkField> BULK_EMAIL_ENTRIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("BulkEmailEntries") .getter(getter(SendBulkEmailRequest::bulkEmailEntries)) .setter(setter(Builder::bulkEmailEntries)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BulkEmailEntries").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(BulkEmailEntry::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField CONFIGURATION_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ConfigurationSetName").getter(getter(SendBulkEmailRequest::configurationSetName)) .setter(setter(Builder::configurationSetName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationSetName").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FROM_EMAIL_ADDRESS_FIELD, FROM_EMAIL_ADDRESS_IDENTITY_ARN_FIELD, REPLY_TO_ADDRESSES_FIELD, FEEDBACK_FORWARDING_EMAIL_ADDRESS_FIELD, FEEDBACK_FORWARDING_EMAIL_ADDRESS_IDENTITY_ARN_FIELD, DEFAULT_EMAIL_TAGS_FIELD, DEFAULT_CONTENT_FIELD, BULK_EMAIL_ENTRIES_FIELD, CONFIGURATION_SET_NAME_FIELD)); private final String fromEmailAddress; private final String fromEmailAddressIdentityArn; private final List replyToAddresses; private final String feedbackForwardingEmailAddress; private final String feedbackForwardingEmailAddressIdentityArn; private final List defaultEmailTags; private final BulkEmailContent defaultContent; private final List bulkEmailEntries; private final String configurationSetName; private SendBulkEmailRequest(BuilderImpl builder) { super(builder); this.fromEmailAddress = builder.fromEmailAddress; this.fromEmailAddressIdentityArn = builder.fromEmailAddressIdentityArn; this.replyToAddresses = builder.replyToAddresses; this.feedbackForwardingEmailAddress = builder.feedbackForwardingEmailAddress; this.feedbackForwardingEmailAddressIdentityArn = builder.feedbackForwardingEmailAddressIdentityArn; this.defaultEmailTags = builder.defaultEmailTags; this.defaultContent = builder.defaultContent; this.bulkEmailEntries = builder.bulkEmailEntries; this.configurationSetName = builder.configurationSetName; } /** *

* The email address to use as the "From" address for the email. The address that you specify has to be verified. *

* * @return The email address to use as the "From" address for the email. The address that you specify has to be * verified. */ public final String fromEmailAddress() { return fromEmailAddress; } /** *

* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the * sending authorization policy that permits you to use the email address specified in the * FromEmailAddress parameter. *

*

* For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) * attaches a policy to it that authorizes you to use [email protected], then you would specify the * FromEmailAddressIdentityArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and the * FromEmailAddress to be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES Developer * Guide. *

* * @return This parameter is used only for sending authorization. It is the ARN of the identity that is associated * with the sending authorization policy that permits you to use the email address specified in the * FromEmailAddress parameter.

*

* For example, if the owner of example.com (which has ARN * arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to * use [email protected], then you would specify the FromEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be * [email protected]. *

*

* For more information about sending authorization, see the Amazon SES * Developer Guide. */ public final String fromEmailAddressIdentityArn() { return fromEmailAddressIdentityArn; } /** * For responses, this returns true if the service returned a value for the ReplyToAddresses property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasReplyToAddresses() { return replyToAddresses != null && !(replyToAddresses instanceof SdkAutoConstructList); } /** *

* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address * receives the reply. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasReplyToAddresses} method. *

* * @return The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to * address receives the reply. */ public final List replyToAddresses() { return replyToAddresses; } /** *

* The address that you want bounce and complaint notifications to be sent to. *

* * @return The address that you want bounce and complaint notifications to be sent to. */ public final String feedbackForwardingEmailAddress() { return feedbackForwardingEmailAddress; } /** *

* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the * sending authorization policy that permits you to use the email address specified in the * FeedbackForwardingEmailAddress parameter. *

*

* For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) * attaches a policy to it that authorizes you to use [email protected], then you would specify the * FeedbackForwardingEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FeedbackForwardingEmailAddress to * be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES Developer * Guide. *

* * @return This parameter is used only for sending authorization. It is the ARN of the identity that is associated * with the sending authorization policy that permits you to use the email address specified in the * FeedbackForwardingEmailAddress parameter.

*

* For example, if the owner of example.com (which has ARN * arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to * use [email protected], then you would specify the * FeedbackForwardingEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the * FeedbackForwardingEmailAddress to be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES * Developer Guide. */ public final String feedbackForwardingEmailAddressIdentityArn() { return feedbackForwardingEmailAddressIdentityArn; } /** * For responses, this returns true if the service returned a value for the DefaultEmailTags property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasDefaultEmailTags() { return defaultEmailTags != null && !(defaultEmailTags instanceof SdkAutoConstructList); } /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so that you * can publish email sending events. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasDefaultEmailTags} method. *

* * @return A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so * that you can publish email sending events. */ public final List defaultEmailTags() { return defaultEmailTags; } /** *

* An object that contains the body of the message. You can specify a template message. *

* * @return An object that contains the body of the message. You can specify a template message. */ public final BulkEmailContent defaultContent() { return defaultContent; } /** * For responses, this returns true if the service returned a value for the BulkEmailEntries property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasBulkEmailEntries() { return bulkEmailEntries != null && !(bulkEmailEntries instanceof SdkAutoConstructList); } /** *

* The list of bulk email entry objects. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasBulkEmailEntries} method. *

* * @return The list of bulk email entry objects. */ public final List bulkEmailEntries() { return bulkEmailEntries; } /** *

* The name of the configuration set to use when sending the email. *

* * @return The name of the configuration set to use when sending the email. */ public final String configurationSetName() { return configurationSetName; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(fromEmailAddress()); hashCode = 31 * hashCode + Objects.hashCode(fromEmailAddressIdentityArn()); hashCode = 31 * hashCode + Objects.hashCode(hasReplyToAddresses() ? replyToAddresses() : null); hashCode = 31 * hashCode + Objects.hashCode(feedbackForwardingEmailAddress()); hashCode = 31 * hashCode + Objects.hashCode(feedbackForwardingEmailAddressIdentityArn()); hashCode = 31 * hashCode + Objects.hashCode(hasDefaultEmailTags() ? defaultEmailTags() : null); hashCode = 31 * hashCode + Objects.hashCode(defaultContent()); hashCode = 31 * hashCode + Objects.hashCode(hasBulkEmailEntries() ? bulkEmailEntries() : null); hashCode = 31 * hashCode + Objects.hashCode(configurationSetName()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SendBulkEmailRequest)) { return false; } SendBulkEmailRequest other = (SendBulkEmailRequest) obj; return Objects.equals(fromEmailAddress(), other.fromEmailAddress()) && Objects.equals(fromEmailAddressIdentityArn(), other.fromEmailAddressIdentityArn()) && hasReplyToAddresses() == other.hasReplyToAddresses() && Objects.equals(replyToAddresses(), other.replyToAddresses()) && Objects.equals(feedbackForwardingEmailAddress(), other.feedbackForwardingEmailAddress()) && Objects.equals(feedbackForwardingEmailAddressIdentityArn(), other.feedbackForwardingEmailAddressIdentityArn()) && hasDefaultEmailTags() == other.hasDefaultEmailTags() && Objects.equals(defaultEmailTags(), other.defaultEmailTags()) && Objects.equals(defaultContent(), other.defaultContent()) && hasBulkEmailEntries() == other.hasBulkEmailEntries() && Objects.equals(bulkEmailEntries(), other.bulkEmailEntries()) && Objects.equals(configurationSetName(), other.configurationSetName()); } /** * 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. */ @Override public final String toString() { return ToString.builder("SendBulkEmailRequest").add("FromEmailAddress", fromEmailAddress()) .add("FromEmailAddressIdentityArn", fromEmailAddressIdentityArn()) .add("ReplyToAddresses", hasReplyToAddresses() ? replyToAddresses() : null) .add("FeedbackForwardingEmailAddress", feedbackForwardingEmailAddress()) .add("FeedbackForwardingEmailAddressIdentityArn", feedbackForwardingEmailAddressIdentityArn()) .add("DefaultEmailTags", hasDefaultEmailTags() ? defaultEmailTags() : null) .add("DefaultContent", defaultContent()) .add("BulkEmailEntries", hasBulkEmailEntries() ? bulkEmailEntries() : null) .add("ConfigurationSetName", configurationSetName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "FromEmailAddress": return Optional.ofNullable(clazz.cast(fromEmailAddress())); case "FromEmailAddressIdentityArn": return Optional.ofNullable(clazz.cast(fromEmailAddressIdentityArn())); case "ReplyToAddresses": return Optional.ofNullable(clazz.cast(replyToAddresses())); case "FeedbackForwardingEmailAddress": return Optional.ofNullable(clazz.cast(feedbackForwardingEmailAddress())); case "FeedbackForwardingEmailAddressIdentityArn": return Optional.ofNullable(clazz.cast(feedbackForwardingEmailAddressIdentityArn())); case "DefaultEmailTags": return Optional.ofNullable(clazz.cast(defaultEmailTags())); case "DefaultContent": return Optional.ofNullable(clazz.cast(defaultContent())); case "BulkEmailEntries": return Optional.ofNullable(clazz.cast(bulkEmailEntries())); case "ConfigurationSetName": return Optional.ofNullable(clazz.cast(configurationSetName())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SendBulkEmailRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SesV2Request.Builder, SdkPojo, CopyableBuilder { /** *

* The email address to use as the "From" address for the email. The address that you specify has to be * verified. *

* * @param fromEmailAddress * The email address to use as the "From" address for the email. The address that you specify has to be * verified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fromEmailAddress(String fromEmailAddress); /** *

* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with * the sending authorization policy that permits you to use the email address specified in the * FromEmailAddress parameter. *

*

* For example, if the owner of example.com (which has ARN * arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use * [email protected], then you would specify the FromEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be * [email protected]. *

*

* For more information about sending authorization, see the Amazon SES Developer * Guide. *

* * @param fromEmailAddressIdentityArn * This parameter is used only for sending authorization. It is the ARN of the identity that is * associated with the sending authorization policy that permits you to use the email address specified * in the FromEmailAddress parameter.

*

* For example, if the owner of example.com (which has ARN * arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you * to use [email protected], then you would specify the FromEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FromEmailAddress to be * [email protected]. *

*

* For more information about sending authorization, see the Amazon SES * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fromEmailAddressIdentityArn(String fromEmailAddressIdentityArn); /** *

* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to * address receives the reply. *

* * @param replyToAddresses * The "Reply-to" email addresses for the message. When the recipient replies to the message, each * Reply-to address receives the reply. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replyToAddresses(Collection replyToAddresses); /** *

* The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to * address receives the reply. *

* * @param replyToAddresses * The "Reply-to" email addresses for the message. When the recipient replies to the message, each * Reply-to address receives the reply. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replyToAddresses(String... replyToAddresses); /** *

* The address that you want bounce and complaint notifications to be sent to. *

* * @param feedbackForwardingEmailAddress * The address that you want bounce and complaint notifications to be sent to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder feedbackForwardingEmailAddress(String feedbackForwardingEmailAddress); /** *

* This parameter is used only for sending authorization. It is the ARN of the identity that is associated with * the sending authorization policy that permits you to use the email address specified in the * FeedbackForwardingEmailAddress parameter. *

*

* For example, if the owner of example.com (which has ARN * arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use * [email protected], then you would specify the FeedbackForwardingEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the FeedbackForwardingEmailAddress * to be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES Developer * Guide. *

* * @param feedbackForwardingEmailAddressIdentityArn * This parameter is used only for sending authorization. It is the ARN of the identity that is * associated with the sending authorization policy that permits you to use the email address specified * in the FeedbackForwardingEmailAddress parameter.

*

* For example, if the owner of example.com (which has ARN * arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you * to use [email protected], then you would specify the * FeedbackForwardingEmailAddressIdentityArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the * FeedbackForwardingEmailAddress to be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder feedbackForwardingEmailAddressIdentityArn(String feedbackForwardingEmailAddressIdentityArn); /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so that * you can publish email sending events. *

* * @param defaultEmailTags * A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so * that you can publish email sending events. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultEmailTags(Collection defaultEmailTags); /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so that * you can publish email sending events. *

* * @param defaultEmailTags * A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so * that you can publish email sending events. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultEmailTags(MessageTag... defaultEmailTags); /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send using the * SendEmail operation. Tags correspond to characteristics of the email that you define, so that * you can publish email sending events. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sesv2.model.MessageTag.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.sesv2.model.MessageTag#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sesv2.model.MessageTag.Builder#build()} is called immediately and its * result is passed to {@link #defaultEmailTags(List)}. * * @param defaultEmailTags * a consumer that will call methods on * {@link software.amazon.awssdk.services.sesv2.model.MessageTag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #defaultEmailTags(java.util.Collection) */ Builder defaultEmailTags(Consumer... defaultEmailTags); /** *

* An object that contains the body of the message. You can specify a template message. *

* * @param defaultContent * An object that contains the body of the message. You can specify a template message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultContent(BulkEmailContent defaultContent); /** *

* An object that contains the body of the message. You can specify a template message. *

* This is a convenience method that creates an instance of the {@link BulkEmailContent.Builder} avoiding the * need to create one manually via {@link BulkEmailContent#builder()}. * *

* When the {@link Consumer} completes, {@link BulkEmailContent.Builder#build()} is called immediately and its * result is passed to {@link #defaultContent(BulkEmailContent)}. * * @param defaultContent * a consumer that will call methods on {@link BulkEmailContent.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #defaultContent(BulkEmailContent) */ default Builder defaultContent(Consumer defaultContent) { return defaultContent(BulkEmailContent.builder().applyMutation(defaultContent).build()); } /** *

* The list of bulk email entry objects. *

* * @param bulkEmailEntries * The list of bulk email entry objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bulkEmailEntries(Collection bulkEmailEntries); /** *

* The list of bulk email entry objects. *

* * @param bulkEmailEntries * The list of bulk email entry objects. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bulkEmailEntries(BulkEmailEntry... bulkEmailEntries); /** *

* The list of bulk email entry objects. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sesv2.model.BulkEmailEntry.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.sesv2.model.BulkEmailEntry#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sesv2.model.BulkEmailEntry.Builder#build()} is called immediately and * its result is passed to {@link #bulkEmailEntries(List)}. * * @param bulkEmailEntries * a consumer that will call methods on * {@link software.amazon.awssdk.services.sesv2.model.BulkEmailEntry.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #bulkEmailEntries(java.util.Collection) */ Builder bulkEmailEntries(Consumer... bulkEmailEntries); /** *

* The name of the configuration set to use when sending the email. *

* * @param configurationSetName * The name of the configuration set to use when sending the email. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configurationSetName(String configurationSetName); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SesV2Request.BuilderImpl implements Builder { private String fromEmailAddress; private String fromEmailAddressIdentityArn; private List replyToAddresses = DefaultSdkAutoConstructList.getInstance(); private String feedbackForwardingEmailAddress; private String feedbackForwardingEmailAddressIdentityArn; private List defaultEmailTags = DefaultSdkAutoConstructList.getInstance(); private BulkEmailContent defaultContent; private List bulkEmailEntries = DefaultSdkAutoConstructList.getInstance(); private String configurationSetName; private BuilderImpl() { } private BuilderImpl(SendBulkEmailRequest model) { super(model); fromEmailAddress(model.fromEmailAddress); fromEmailAddressIdentityArn(model.fromEmailAddressIdentityArn); replyToAddresses(model.replyToAddresses); feedbackForwardingEmailAddress(model.feedbackForwardingEmailAddress); feedbackForwardingEmailAddressIdentityArn(model.feedbackForwardingEmailAddressIdentityArn); defaultEmailTags(model.defaultEmailTags); defaultContent(model.defaultContent); bulkEmailEntries(model.bulkEmailEntries); configurationSetName(model.configurationSetName); } public final String getFromEmailAddress() { return fromEmailAddress; } public final void setFromEmailAddress(String fromEmailAddress) { this.fromEmailAddress = fromEmailAddress; } @Override public final Builder fromEmailAddress(String fromEmailAddress) { this.fromEmailAddress = fromEmailAddress; return this; } public final String getFromEmailAddressIdentityArn() { return fromEmailAddressIdentityArn; } public final void setFromEmailAddressIdentityArn(String fromEmailAddressIdentityArn) { this.fromEmailAddressIdentityArn = fromEmailAddressIdentityArn; } @Override public final Builder fromEmailAddressIdentityArn(String fromEmailAddressIdentityArn) { this.fromEmailAddressIdentityArn = fromEmailAddressIdentityArn; return this; } public final Collection getReplyToAddresses() { if (replyToAddresses instanceof SdkAutoConstructList) { return null; } return replyToAddresses; } public final void setReplyToAddresses(Collection replyToAddresses) { this.replyToAddresses = EmailAddressListCopier.copy(replyToAddresses); } @Override public final Builder replyToAddresses(Collection replyToAddresses) { this.replyToAddresses = EmailAddressListCopier.copy(replyToAddresses); return this; } @Override @SafeVarargs public final Builder replyToAddresses(String... replyToAddresses) { replyToAddresses(Arrays.asList(replyToAddresses)); return this; } public final String getFeedbackForwardingEmailAddress() { return feedbackForwardingEmailAddress; } public final void setFeedbackForwardingEmailAddress(String feedbackForwardingEmailAddress) { this.feedbackForwardingEmailAddress = feedbackForwardingEmailAddress; } @Override public final Builder feedbackForwardingEmailAddress(String feedbackForwardingEmailAddress) { this.feedbackForwardingEmailAddress = feedbackForwardingEmailAddress; return this; } public final String getFeedbackForwardingEmailAddressIdentityArn() { return feedbackForwardingEmailAddressIdentityArn; } public final void setFeedbackForwardingEmailAddressIdentityArn(String feedbackForwardingEmailAddressIdentityArn) { this.feedbackForwardingEmailAddressIdentityArn = feedbackForwardingEmailAddressIdentityArn; } @Override public final Builder feedbackForwardingEmailAddressIdentityArn(String feedbackForwardingEmailAddressIdentityArn) { this.feedbackForwardingEmailAddressIdentityArn = feedbackForwardingEmailAddressIdentityArn; return this; } public final List getDefaultEmailTags() { List result = MessageTagListCopier.copyToBuilder(this.defaultEmailTags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setDefaultEmailTags(Collection defaultEmailTags) { this.defaultEmailTags = MessageTagListCopier.copyFromBuilder(defaultEmailTags); } @Override public final Builder defaultEmailTags(Collection defaultEmailTags) { this.defaultEmailTags = MessageTagListCopier.copy(defaultEmailTags); return this; } @Override @SafeVarargs public final Builder defaultEmailTags(MessageTag... defaultEmailTags) { defaultEmailTags(Arrays.asList(defaultEmailTags)); return this; } @Override @SafeVarargs public final Builder defaultEmailTags(Consumer... defaultEmailTags) { defaultEmailTags(Stream.of(defaultEmailTags).map(c -> MessageTag.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final BulkEmailContent.Builder getDefaultContent() { return defaultContent != null ? defaultContent.toBuilder() : null; } public final void setDefaultContent(BulkEmailContent.BuilderImpl defaultContent) { this.defaultContent = defaultContent != null ? defaultContent.build() : null; } @Override public final Builder defaultContent(BulkEmailContent defaultContent) { this.defaultContent = defaultContent; return this; } public final List getBulkEmailEntries() { List result = BulkEmailEntryListCopier.copyToBuilder(this.bulkEmailEntries); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setBulkEmailEntries(Collection bulkEmailEntries) { this.bulkEmailEntries = BulkEmailEntryListCopier.copyFromBuilder(bulkEmailEntries); } @Override public final Builder bulkEmailEntries(Collection bulkEmailEntries) { this.bulkEmailEntries = BulkEmailEntryListCopier.copy(bulkEmailEntries); return this; } @Override @SafeVarargs public final Builder bulkEmailEntries(BulkEmailEntry... bulkEmailEntries) { bulkEmailEntries(Arrays.asList(bulkEmailEntries)); return this; } @Override @SafeVarargs public final Builder bulkEmailEntries(Consumer... bulkEmailEntries) { bulkEmailEntries(Stream.of(bulkEmailEntries).map(c -> BulkEmailEntry.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getConfigurationSetName() { return configurationSetName; } public final void setConfigurationSetName(String configurationSetName) { this.configurationSetName = configurationSetName; } @Override public final Builder configurationSetName(String configurationSetName) { this.configurationSetName = configurationSetName; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public SendBulkEmailRequest build() { return new SendBulkEmailRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy