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

software.amazon.awssdk.services.ses.model.SendBulkTemplatedEmailRequest 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.ses.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 a templated email to multiple destinations using Amazon SES. For more information, see * the Amazon SES Developer * Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SendBulkTemplatedEmailRequest extends SesRequest implements ToCopyableBuilder { private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Source") .getter(getter(SendBulkTemplatedEmailRequest::source)).setter(setter(Builder::source)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build(); private static final SdkField SOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceArn").getter(getter(SendBulkTemplatedEmailRequest::sourceArn)).setter(setter(Builder::sourceArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceArn").build()).build(); private static final SdkField> REPLY_TO_ADDRESSES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ReplyToAddresses") .getter(getter(SendBulkTemplatedEmailRequest::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 RETURN_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ReturnPath").getter(getter(SendBulkTemplatedEmailRequest::returnPath)) .setter(setter(Builder::returnPath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReturnPath").build()).build(); private static final SdkField RETURN_PATH_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ReturnPathArn").getter(getter(SendBulkTemplatedEmailRequest::returnPathArn)) .setter(setter(Builder::returnPathArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReturnPathArn").build()).build(); private static final SdkField CONFIGURATION_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ConfigurationSetName").getter(getter(SendBulkTemplatedEmailRequest::configurationSetName)) .setter(setter(Builder::configurationSetName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationSetName").build()) .build(); private static final SdkField> DEFAULT_TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DefaultTags") .getter(getter(SendBulkTemplatedEmailRequest::defaultTags)) .setter(setter(Builder::defaultTags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultTags").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 TEMPLATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Template").getter(getter(SendBulkTemplatedEmailRequest::template)).setter(setter(Builder::template)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Template").build()).build(); private static final SdkField TEMPLATE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TemplateArn").getter(getter(SendBulkTemplatedEmailRequest::templateArn)) .setter(setter(Builder::templateArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemplateArn").build()).build(); private static final SdkField DEFAULT_TEMPLATE_DATA_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DefaultTemplateData").getter(getter(SendBulkTemplatedEmailRequest::defaultTemplateData)) .setter(setter(Builder::defaultTemplateData)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultTemplateData").build()) .build(); private static final SdkField> DESTINATIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Destinations") .getter(getter(SendBulkTemplatedEmailRequest::destinations)) .setter(setter(Builder::destinations)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Destinations").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(BulkEmailDestination::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_FIELD, SOURCE_ARN_FIELD, REPLY_TO_ADDRESSES_FIELD, RETURN_PATH_FIELD, RETURN_PATH_ARN_FIELD, CONFIGURATION_SET_NAME_FIELD, DEFAULT_TAGS_FIELD, TEMPLATE_FIELD, TEMPLATE_ARN_FIELD, DEFAULT_TEMPLATE_DATA_FIELD, DESTINATIONS_FIELD)); private final String source; private final String sourceArn; private final List replyToAddresses; private final String returnPath; private final String returnPathArn; private final String configurationSetName; private final List defaultTags; private final String template; private final String templateArn; private final String defaultTemplateData; private final List destinations; private SendBulkTemplatedEmailRequest(BuilderImpl builder) { super(builder); this.source = builder.source; this.sourceArn = builder.sourceArn; this.replyToAddresses = builder.replyToAddresses; this.returnPath = builder.returnPath; this.returnPathArn = builder.returnPathArn; this.configurationSetName = builder.configurationSetName; this.defaultTags = builder.defaultTags; this.template = builder.template; this.templateArn = builder.templateArn; this.defaultTemplateData = builder.defaultTemplateData; this.destinations = builder.destinations; } /** *

* The email address that is sending the email. This email address must be either individually verified with Amazon * SES, or from a domain that has been verified with Amazon SES. For information about verifying identities, see the * Amazon SES Developer Guide. *

*

* If you are sending on behalf of another user and have been permitted to do so by a sending authorization policy, * then you must also specify the SourceArn parameter. For more information about sending * authorization, see the Amazon SES * Developer Guide. *

* *

* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the email address string must be 7-bit * ASCII. If you want to send to or from email addresses that contain Unicode characters in the domain part of an * address, you must encode the domain using Punycode. Punycode is not permitted in the local part of the email * address (the part before the @ sign) nor in the "friendly from" name. If you want to use Unicode characters in * the "friendly from" name, you must encode the "friendly from" name using MIME encoded-word syntax, as described * in Sending raw email using the Amazon SES * API. For more information about Punycode, see RFC 3492. *

*
* * @return The email address that is sending the email. This email address must be either individually verified with * Amazon SES, or from a domain that has been verified with Amazon SES. For information about verifying * identities, see the Amazon * SES Developer Guide.

*

* If you are sending on behalf of another user and have been permitted to do so by a sending authorization * policy, then you must also specify the SourceArn parameter. For more information about * sending authorization, see the Amazon SES Developer * Guide. *

* *

* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the email address string must be * 7-bit ASCII. If you want to send to or from email addresses that contain Unicode characters in the domain * part of an address, you must encode the domain using Punycode. Punycode is not permitted in the local * part of the email address (the part before the @ sign) nor in the "friendly from" name. If you want to * use Unicode characters in the "friendly from" name, you must encode the "friendly from" name using MIME * encoded-word syntax, as described in Sending raw email using the Amazon * SES API. For more information about Punycode, see RFC * 3492. *

*/ public final String source() { return source; } /** *

* 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 send for the email address specified in the Source * 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 send from [email protected], then you would specify the SourceArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the Source 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 send for the email address specified in the * Source 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 send from [email protected], then you would specify the * SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and * the Source to be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES Developer * Guide. */ public final String sourceArn() { return sourceArn; } /** * 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 address(es) for the message. If 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 address(es) for the message. If the recipient replies to the message, each reply-to * address receives the reply. */ public final List replyToAddresses() { return replyToAddresses; } /** *

* The email address that bounces and complaints are forwarded to when feedback forwarding is enabled. If the * message cannot be delivered to the recipient, then an error message is returned from the recipient's ISP; this * message is forwarded to the email address specified by the ReturnPath parameter. The * ReturnPath parameter is never overwritten. This email address must be either individually verified * with Amazon SES, or from a domain that has been verified with Amazon SES. *

* * @return The email address that bounces and complaints are forwarded to when feedback forwarding is enabled. If * the message cannot be delivered to the recipient, then an error message is returned from the recipient's * ISP; this message is forwarded to the email address specified by the ReturnPath parameter. * The ReturnPath parameter is never overwritten. This email address must be either * individually verified with Amazon SES, or from a domain that has been verified with Amazon SES. */ public final String returnPath() { return returnPath; } /** *

* 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 ReturnPath * 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 ReturnPathArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the ReturnPath 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 * ReturnPath 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 * ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, * and the ReturnPath to be [email protected]. *

*

* For more information about sending authorization, see the Amazon SES Developer * Guide. */ public final String returnPathArn() { return returnPathArn; } /** *

* The name of the configuration set to use when you send an email using SendBulkTemplatedEmail. *

* * @return The name of the configuration set to use when you send an email using SendBulkTemplatedEmail * . */ public final String configurationSetName() { return configurationSetName; } /** * For responses, this returns true if the service returned a value for the DefaultTags 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 hasDefaultTags() { return defaultTags != null && !(defaultTags instanceof SdkAutoConstructList); } /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination using * SendBulkTemplatedEmail. *

*

* 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 #hasDefaultTags} method. *

* * @return A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination * using SendBulkTemplatedEmail. */ public final List defaultTags() { return defaultTags; } /** *

* The template to use when sending this email. *

* * @return The template to use when sending this email. */ public final String template() { return template; } /** *

* The ARN of the template to use when sending this email. *

* * @return The ARN of the template to use when sending this email. */ public final String templateArn() { return templateArn; } /** *

* A list of replacement values to apply to the template when replacement data is not specified in a Destination * object. These values act as a default or fallback option when no other data is available. *

*

* The template data is a JSON object, typically consisting of key-value pairs in which the keys correspond to * replacement tags in the email template. *

* * @return A list of replacement values to apply to the template when replacement data is not specified in a * Destination object. These values act as a default or fallback option when no other data is available.

*

* The template data is a JSON object, typically consisting of key-value pairs in which the keys correspond * to replacement tags in the email template. */ public final String defaultTemplateData() { return defaultTemplateData; } /** * For responses, this returns true if the service returned a value for the Destinations 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 hasDestinations() { return destinations != null && !(destinations instanceof SdkAutoConstructList); } /** *

* One or more Destination objects. All of the recipients in a Destination receive the * same version of the email. You can specify up to 50 Destination objects within a * Destinations array. *

*

* 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 #hasDestinations} method. *

* * @return One or more Destination objects. All of the recipients in a Destination receive * the same version of the email. You can specify up to 50 Destination objects within a * Destinations array. */ public final List destinations() { return destinations; } @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(source()); hashCode = 31 * hashCode + Objects.hashCode(sourceArn()); hashCode = 31 * hashCode + Objects.hashCode(hasReplyToAddresses() ? replyToAddresses() : null); hashCode = 31 * hashCode + Objects.hashCode(returnPath()); hashCode = 31 * hashCode + Objects.hashCode(returnPathArn()); hashCode = 31 * hashCode + Objects.hashCode(configurationSetName()); hashCode = 31 * hashCode + Objects.hashCode(hasDefaultTags() ? defaultTags() : null); hashCode = 31 * hashCode + Objects.hashCode(template()); hashCode = 31 * hashCode + Objects.hashCode(templateArn()); hashCode = 31 * hashCode + Objects.hashCode(defaultTemplateData()); hashCode = 31 * hashCode + Objects.hashCode(hasDestinations() ? destinations() : null); 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 SendBulkTemplatedEmailRequest)) { return false; } SendBulkTemplatedEmailRequest other = (SendBulkTemplatedEmailRequest) obj; return Objects.equals(source(), other.source()) && Objects.equals(sourceArn(), other.sourceArn()) && hasReplyToAddresses() == other.hasReplyToAddresses() && Objects.equals(replyToAddresses(), other.replyToAddresses()) && Objects.equals(returnPath(), other.returnPath()) && Objects.equals(returnPathArn(), other.returnPathArn()) && Objects.equals(configurationSetName(), other.configurationSetName()) && hasDefaultTags() == other.hasDefaultTags() && Objects.equals(defaultTags(), other.defaultTags()) && Objects.equals(template(), other.template()) && Objects.equals(templateArn(), other.templateArn()) && Objects.equals(defaultTemplateData(), other.defaultTemplateData()) && hasDestinations() == other.hasDestinations() && Objects.equals(destinations(), other.destinations()); } /** * 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("SendBulkTemplatedEmailRequest").add("Source", source()).add("SourceArn", sourceArn()) .add("ReplyToAddresses", hasReplyToAddresses() ? replyToAddresses() : null).add("ReturnPath", returnPath()) .add("ReturnPathArn", returnPathArn()).add("ConfigurationSetName", configurationSetName()) .add("DefaultTags", hasDefaultTags() ? defaultTags() : null).add("Template", template()) .add("TemplateArn", templateArn()).add("DefaultTemplateData", defaultTemplateData()) .add("Destinations", hasDestinations() ? destinations() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Source": return Optional.ofNullable(clazz.cast(source())); case "SourceArn": return Optional.ofNullable(clazz.cast(sourceArn())); case "ReplyToAddresses": return Optional.ofNullable(clazz.cast(replyToAddresses())); case "ReturnPath": return Optional.ofNullable(clazz.cast(returnPath())); case "ReturnPathArn": return Optional.ofNullable(clazz.cast(returnPathArn())); case "ConfigurationSetName": return Optional.ofNullable(clazz.cast(configurationSetName())); case "DefaultTags": return Optional.ofNullable(clazz.cast(defaultTags())); case "Template": return Optional.ofNullable(clazz.cast(template())); case "TemplateArn": return Optional.ofNullable(clazz.cast(templateArn())); case "DefaultTemplateData": return Optional.ofNullable(clazz.cast(defaultTemplateData())); case "Destinations": return Optional.ofNullable(clazz.cast(destinations())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SendBulkTemplatedEmailRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SesRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The email address that is sending the email. This email address must be either individually verified with * Amazon SES, or from a domain that has been verified with Amazon SES. For information about verifying * identities, see the Amazon SES * Developer Guide. *

*

* If you are sending on behalf of another user and have been permitted to do so by a sending authorization * policy, then you must also specify the SourceArn parameter. For more information about sending * authorization, see the Amazon * SES Developer Guide. *

* *

* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the email address string must be * 7-bit ASCII. If you want to send to or from email addresses that contain Unicode characters in the domain * part of an address, you must encode the domain using Punycode. Punycode is not permitted in the local part of * the email address (the part before the @ sign) nor in the "friendly from" name. If you want to use Unicode * characters in the "friendly from" name, you must encode the "friendly from" name using MIME encoded-word * syntax, as described in Sending raw * email using the Amazon SES API. For more information about Punycode, see RFC 3492. *

*
* * @param source * The email address that is sending the email. This email address must be either individually verified * with Amazon SES, or from a domain that has been verified with Amazon SES. For information about * verifying identities, see the Amazon SES Developer * Guide.

*

* If you are sending on behalf of another user and have been permitted to do so by a sending * authorization policy, then you must also specify the SourceArn parameter. For more * information about sending authorization, see the Amazon SES Developer * Guide. *

* *

* Amazon SES does not support the SMTPUTF8 extension, as described in RFC6531. For this reason, the email address string must * be 7-bit ASCII. If you want to send to or from email addresses that contain Unicode characters in the * domain part of an address, you must encode the domain using Punycode. Punycode is not permitted in the * local part of the email address (the part before the @ sign) nor in the "friendly from" name. If you * want to use Unicode characters in the "friendly from" name, you must encode the "friendly from" name * using MIME encoded-word syntax, as described in Sending raw email using the * Amazon SES API. For more information about Punycode, see RFC 3492. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder source(String source); /** *

* 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 send for the email address specified in the * Source 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 send from [email protected], then you would specify the SourceArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the Source to be * [email protected]. *

*

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

* * @param sourceArn * 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 send for the email address * specified in the Source 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 send from [email protected], then you would specify the * SourceArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, and * the Source 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 sourceArn(String sourceArn); /** *

* The reply-to email address(es) for the message. If the recipient replies to the message, each reply-to * address receives the reply. *

* * @param replyToAddresses * The reply-to email address(es) for the message. If 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 address(es) for the message. If the recipient replies to the message, each reply-to * address receives the reply. *

* * @param replyToAddresses * The reply-to email address(es) for the message. If 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 email address that bounces and complaints are forwarded to when feedback forwarding is enabled. If the * message cannot be delivered to the recipient, then an error message is returned from the recipient's ISP; * this message is forwarded to the email address specified by the ReturnPath parameter. The * ReturnPath parameter is never overwritten. This email address must be either individually * verified with Amazon SES, or from a domain that has been verified with Amazon SES. *

* * @param returnPath * The email address that bounces and complaints are forwarded to when feedback forwarding is enabled. If * the message cannot be delivered to the recipient, then an error message is returned from the * recipient's ISP; this message is forwarded to the email address specified by the * ReturnPath parameter. The ReturnPath parameter is never overwritten. This * email address must be either individually verified with Amazon SES, or from a domain that has been * verified with Amazon SES. * @return Returns a reference to this object so that method calls can be chained together. */ Builder returnPath(String returnPath); /** *

* 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 * ReturnPath 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 ReturnPathArn to be * arn:aws:ses:us-east-1:123456789012:identity/example.com, and the ReturnPath to be * [email protected]. *

*

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

* * @param returnPathArn * 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 ReturnPath 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 * ReturnPathArn to be arn:aws:ses:us-east-1:123456789012:identity/example.com, * and the ReturnPath 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 returnPathArn(String returnPathArn); /** *

* The name of the configuration set to use when you send an email using SendBulkTemplatedEmail. *

* * @param configurationSetName * The name of the configuration set to use when you send an email using * SendBulkTemplatedEmail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configurationSetName(String configurationSetName); /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination using * SendBulkTemplatedEmail. *

* * @param defaultTags * A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination * using SendBulkTemplatedEmail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultTags(Collection defaultTags); /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination using * SendBulkTemplatedEmail. *

* * @param defaultTags * A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination * using SendBulkTemplatedEmail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultTags(MessageTag... defaultTags); /** *

* A list of tags, in the form of name/value pairs, to apply to an email that you send to a destination using * SendBulkTemplatedEmail. *

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

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

* The template to use when sending this email. *

* * @param template * The template to use when sending this email. * @return Returns a reference to this object so that method calls can be chained together. */ Builder template(String template); /** *

* The ARN of the template to use when sending this email. *

* * @param templateArn * The ARN of the template to use when sending this email. * @return Returns a reference to this object so that method calls can be chained together. */ Builder templateArn(String templateArn); /** *

* A list of replacement values to apply to the template when replacement data is not specified in a Destination * object. These values act as a default or fallback option when no other data is available. *

*

* The template data is a JSON object, typically consisting of key-value pairs in which the keys correspond to * replacement tags in the email template. *

* * @param defaultTemplateData * A list of replacement values to apply to the template when replacement data is not specified in a * Destination object. These values act as a default or fallback option when no other data is * available.

*

* The template data is a JSON object, typically consisting of key-value pairs in which the keys * correspond to replacement tags in the email template. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultTemplateData(String defaultTemplateData); /** *

* One or more Destination objects. All of the recipients in a Destination receive the * same version of the email. You can specify up to 50 Destination objects within a * Destinations array. *

* * @param destinations * One or more Destination objects. All of the recipients in a Destination * receive the same version of the email. You can specify up to 50 Destination objects * within a Destinations array. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinations(Collection destinations); /** *

* One or more Destination objects. All of the recipients in a Destination receive the * same version of the email. You can specify up to 50 Destination objects within a * Destinations array. *

* * @param destinations * One or more Destination objects. All of the recipients in a Destination * receive the same version of the email. You can specify up to 50 Destination objects * within a Destinations array. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinations(BulkEmailDestination... destinations); /** *

* One or more Destination objects. All of the recipients in a Destination receive the * same version of the email. You can specify up to 50 Destination objects within a * Destinations array. *

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

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.ses.model.BulkEmailDestination.Builder#build()} is called immediately * and its result is passed to {@link #destinations(List)}. * * @param destinations * a consumer that will call methods on * {@link software.amazon.awssdk.services.ses.model.BulkEmailDestination.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #destinations(java.util.Collection) */ Builder destinations(Consumer... destinations); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends SesRequest.BuilderImpl implements Builder { private String source; private String sourceArn; private List replyToAddresses = DefaultSdkAutoConstructList.getInstance(); private String returnPath; private String returnPathArn; private String configurationSetName; private List defaultTags = DefaultSdkAutoConstructList.getInstance(); private String template; private String templateArn; private String defaultTemplateData; private List destinations = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(SendBulkTemplatedEmailRequest model) { super(model); source(model.source); sourceArn(model.sourceArn); replyToAddresses(model.replyToAddresses); returnPath(model.returnPath); returnPathArn(model.returnPathArn); configurationSetName(model.configurationSetName); defaultTags(model.defaultTags); template(model.template); templateArn(model.templateArn); defaultTemplateData(model.defaultTemplateData); destinations(model.destinations); } public final String getSource() { return source; } public final void setSource(String source) { this.source = source; } @Override public final Builder source(String source) { this.source = source; return this; } public final String getSourceArn() { return sourceArn; } public final void setSourceArn(String sourceArn) { this.sourceArn = sourceArn; } @Override public final Builder sourceArn(String sourceArn) { this.sourceArn = sourceArn; return this; } public final Collection getReplyToAddresses() { if (replyToAddresses instanceof SdkAutoConstructList) { return null; } return replyToAddresses; } public final void setReplyToAddresses(Collection replyToAddresses) { this.replyToAddresses = AddressListCopier.copy(replyToAddresses); } @Override public final Builder replyToAddresses(Collection replyToAddresses) { this.replyToAddresses = AddressListCopier.copy(replyToAddresses); return this; } @Override @SafeVarargs public final Builder replyToAddresses(String... replyToAddresses) { replyToAddresses(Arrays.asList(replyToAddresses)); return this; } public final String getReturnPath() { return returnPath; } public final void setReturnPath(String returnPath) { this.returnPath = returnPath; } @Override public final Builder returnPath(String returnPath) { this.returnPath = returnPath; return this; } public final String getReturnPathArn() { return returnPathArn; } public final void setReturnPathArn(String returnPathArn) { this.returnPathArn = returnPathArn; } @Override public final Builder returnPathArn(String returnPathArn) { this.returnPathArn = returnPathArn; 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; } public final List getDefaultTags() { List result = MessageTagListCopier.copyToBuilder(this.defaultTags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setDefaultTags(Collection defaultTags) { this.defaultTags = MessageTagListCopier.copyFromBuilder(defaultTags); } @Override public final Builder defaultTags(Collection defaultTags) { this.defaultTags = MessageTagListCopier.copy(defaultTags); return this; } @Override @SafeVarargs public final Builder defaultTags(MessageTag... defaultTags) { defaultTags(Arrays.asList(defaultTags)); return this; } @Override @SafeVarargs public final Builder defaultTags(Consumer... defaultTags) { defaultTags(Stream.of(defaultTags).map(c -> MessageTag.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getTemplate() { return template; } public final void setTemplate(String template) { this.template = template; } @Override public final Builder template(String template) { this.template = template; return this; } public final String getTemplateArn() { return templateArn; } public final void setTemplateArn(String templateArn) { this.templateArn = templateArn; } @Override public final Builder templateArn(String templateArn) { this.templateArn = templateArn; return this; } public final String getDefaultTemplateData() { return defaultTemplateData; } public final void setDefaultTemplateData(String defaultTemplateData) { this.defaultTemplateData = defaultTemplateData; } @Override public final Builder defaultTemplateData(String defaultTemplateData) { this.defaultTemplateData = defaultTemplateData; return this; } public final List getDestinations() { List result = BulkEmailDestinationListCopier.copyToBuilder(this.destinations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setDestinations(Collection destinations) { this.destinations = BulkEmailDestinationListCopier.copyFromBuilder(destinations); } @Override public final Builder destinations(Collection destinations) { this.destinations = BulkEmailDestinationListCopier.copy(destinations); return this; } @Override @SafeVarargs public final Builder destinations(BulkEmailDestination... destinations) { destinations(Arrays.asList(destinations)); return this; } @Override @SafeVarargs public final Builder destinations(Consumer... destinations) { destinations(Stream.of(destinations).map(c -> BulkEmailDestination.builder().applyMutation(c).build()) .collect(Collectors.toList())); 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 SendBulkTemplatedEmailRequest build() { return new SendBulkTemplatedEmailRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy