software.amazon.awssdk.services.ses.model.UpdateCustomVerificationEmailTemplateRequest Maven / Gradle / Ivy
Show all versions of ses Show documentation
/*
* 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.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 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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents a request to update an existing custom verification email template.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateCustomVerificationEmailTemplateRequest extends SesRequest implements
ToCopyableBuilder {
private static final SdkField TEMPLATE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TemplateName").getter(getter(UpdateCustomVerificationEmailTemplateRequest::templateName))
.setter(setter(Builder::templateName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemplateName").build()).build();
private static final SdkField FROM_EMAIL_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FromEmailAddress").getter(getter(UpdateCustomVerificationEmailTemplateRequest::fromEmailAddress))
.setter(setter(Builder::fromEmailAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FromEmailAddress").build()).build();
private static final SdkField TEMPLATE_SUBJECT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TemplateSubject").getter(getter(UpdateCustomVerificationEmailTemplateRequest::templateSubject))
.setter(setter(Builder::templateSubject))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemplateSubject").build()).build();
private static final SdkField TEMPLATE_CONTENT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TemplateContent").getter(getter(UpdateCustomVerificationEmailTemplateRequest::templateContent))
.setter(setter(Builder::templateContent))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TemplateContent").build()).build();
private static final SdkField SUCCESS_REDIRECTION_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SuccessRedirectionURL")
.getter(getter(UpdateCustomVerificationEmailTemplateRequest::successRedirectionURL))
.setter(setter(Builder::successRedirectionURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SuccessRedirectionURL").build())
.build();
private static final SdkField FAILURE_REDIRECTION_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailureRedirectionURL")
.getter(getter(UpdateCustomVerificationEmailTemplateRequest::failureRedirectionURL))
.setter(setter(Builder::failureRedirectionURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureRedirectionURL").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TEMPLATE_NAME_FIELD,
FROM_EMAIL_ADDRESS_FIELD, TEMPLATE_SUBJECT_FIELD, TEMPLATE_CONTENT_FIELD, SUCCESS_REDIRECTION_URL_FIELD,
FAILURE_REDIRECTION_URL_FIELD));
private final String templateName;
private final String fromEmailAddress;
private final String templateSubject;
private final String templateContent;
private final String successRedirectionURL;
private final String failureRedirectionURL;
private UpdateCustomVerificationEmailTemplateRequest(BuilderImpl builder) {
super(builder);
this.templateName = builder.templateName;
this.fromEmailAddress = builder.fromEmailAddress;
this.templateSubject = builder.templateSubject;
this.templateContent = builder.templateContent;
this.successRedirectionURL = builder.successRedirectionURL;
this.failureRedirectionURL = builder.failureRedirectionURL;
}
/**
*
* The name of the custom verification email template to update.
*
*
* @return The name of the custom verification email template to update.
*/
public final String templateName() {
return templateName;
}
/**
*
* The email address that the custom verification email is sent from.
*
*
* @return The email address that the custom verification email is sent from.
*/
public final String fromEmailAddress() {
return fromEmailAddress;
}
/**
*
* The subject line of the custom verification email.
*
*
* @return The subject line of the custom verification email.
*/
public final String templateSubject() {
return templateSubject;
}
/**
*
* The content of the custom verification email. The total size of the email must be less than 10 MB. The message
* body may contain HTML, with some limitations. For more information, see Custom
* Verification Email Frequently Asked Questions in the Amazon SES Developer Guide.
*
*
* @return The content of the custom verification email. The total size of the email must be less than 10 MB. The
* message body may contain HTML, with some limitations. For more information, see Custom Verification Email Frequently Asked Questions in the Amazon SES Developer Guide.
*/
public final String templateContent() {
return templateContent;
}
/**
*
* The URL that the recipient of the verification email is sent to if his or her address is successfully verified.
*
*
* @return The URL that the recipient of the verification email is sent to if his or her address is successfully
* verified.
*/
public final String successRedirectionURL() {
return successRedirectionURL;
}
/**
*
* The URL that the recipient of the verification email is sent to if his or her address is not successfully
* verified.
*
*
* @return The URL that the recipient of the verification email is sent to if his or her address is not successfully
* verified.
*/
public final String failureRedirectionURL() {
return failureRedirectionURL;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(templateName());
hashCode = 31 * hashCode + Objects.hashCode(fromEmailAddress());
hashCode = 31 * hashCode + Objects.hashCode(templateSubject());
hashCode = 31 * hashCode + Objects.hashCode(templateContent());
hashCode = 31 * hashCode + Objects.hashCode(successRedirectionURL());
hashCode = 31 * hashCode + Objects.hashCode(failureRedirectionURL());
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 UpdateCustomVerificationEmailTemplateRequest)) {
return false;
}
UpdateCustomVerificationEmailTemplateRequest other = (UpdateCustomVerificationEmailTemplateRequest) obj;
return Objects.equals(templateName(), other.templateName())
&& Objects.equals(fromEmailAddress(), other.fromEmailAddress())
&& Objects.equals(templateSubject(), other.templateSubject())
&& Objects.equals(templateContent(), other.templateContent())
&& Objects.equals(successRedirectionURL(), other.successRedirectionURL())
&& Objects.equals(failureRedirectionURL(), other.failureRedirectionURL());
}
/**
* 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("UpdateCustomVerificationEmailTemplateRequest").add("TemplateName", templateName())
.add("FromEmailAddress", fromEmailAddress()).add("TemplateSubject", templateSubject())
.add("TemplateContent", templateContent()).add("SuccessRedirectionURL", successRedirectionURL())
.add("FailureRedirectionURL", failureRedirectionURL()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TemplateName":
return Optional.ofNullable(clazz.cast(templateName()));
case "FromEmailAddress":
return Optional.ofNullable(clazz.cast(fromEmailAddress()));
case "TemplateSubject":
return Optional.ofNullable(clazz.cast(templateSubject()));
case "TemplateContent":
return Optional.ofNullable(clazz.cast(templateContent()));
case "SuccessRedirectionURL":
return Optional.ofNullable(clazz.cast(successRedirectionURL()));
case "FailureRedirectionURL":
return Optional.ofNullable(clazz.cast(failureRedirectionURL()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function