![JAR search and dependency download from the Maven repository](/logo.png)
software.amazon.awssdk.services.pinpointemail.model.DeliverabilityTestReport Maven / Gradle / Ivy
Show all versions of pinpointemail 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.pinpointemail.model;
import java.io.Serializable;
import java.time.Instant;
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.Function;
import software.amazon.awssdk.annotations.Generated;
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;
/**
*
* An object that contains metadata related to a predictive inbox placement test.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeliverabilityTestReport implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField REPORT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReportId").getter(getter(DeliverabilityTestReport::reportId)).setter(setter(Builder::reportId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportId").build()).build();
private static final SdkField REPORT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReportName").getter(getter(DeliverabilityTestReport::reportName)).setter(setter(Builder::reportName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportName").build()).build();
private static final SdkField SUBJECT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Subject")
.getter(getter(DeliverabilityTestReport::subject)).setter(setter(Builder::subject))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Subject").build()).build();
private static final SdkField FROM_EMAIL_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FromEmailAddress").getter(getter(DeliverabilityTestReport::fromEmailAddress))
.setter(setter(Builder::fromEmailAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FromEmailAddress").build()).build();
private static final SdkField CREATE_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreateDate").getter(getter(DeliverabilityTestReport::createDate)).setter(setter(Builder::createDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreateDate").build()).build();
private static final SdkField DELIVERABILITY_TEST_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeliverabilityTestStatus").getter(getter(DeliverabilityTestReport::deliverabilityTestStatusAsString))
.setter(setter(Builder::deliverabilityTestStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeliverabilityTestStatus").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPORT_ID_FIELD,
REPORT_NAME_FIELD, SUBJECT_FIELD, FROM_EMAIL_ADDRESS_FIELD, CREATE_DATE_FIELD, DELIVERABILITY_TEST_STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final String reportId;
private final String reportName;
private final String subject;
private final String fromEmailAddress;
private final Instant createDate;
private final String deliverabilityTestStatus;
private DeliverabilityTestReport(BuilderImpl builder) {
this.reportId = builder.reportId;
this.reportName = builder.reportName;
this.subject = builder.subject;
this.fromEmailAddress = builder.fromEmailAddress;
this.createDate = builder.createDate;
this.deliverabilityTestStatus = builder.deliverabilityTestStatus;
}
/**
*
* A unique string that identifies the predictive inbox placement test.
*
*
* @return A unique string that identifies the predictive inbox placement test.
*/
public final String reportId() {
return reportId;
}
/**
*
* A name that helps you identify a predictive inbox placement test report.
*
*
* @return A name that helps you identify a predictive inbox placement test report.
*/
public final String reportName() {
return reportName;
}
/**
*
* The subject line for an email that you submitted in a predictive inbox placement test.
*
*
* @return The subject line for an email that you submitted in a predictive inbox placement test.
*/
public final String subject() {
return subject;
}
/**
*
* The sender address that you specified for the predictive inbox placement test.
*
*
* @return The sender address that you specified for the predictive inbox placement test.
*/
public final String fromEmailAddress() {
return fromEmailAddress;
}
/**
*
* The date and time when the predictive inbox placement test was created, in Unix time format.
*
*
* @return The date and time when the predictive inbox placement test was created, in Unix time format.
*/
public final Instant createDate() {
return createDate;
}
/**
*
* The status of the predictive inbox placement test. If the status is IN_PROGRESS
, then the predictive
* inbox placement test is currently running. Predictive inbox placement tests are usually complete within 24 hours
* of creating the test. If the status is COMPLETE
, then the test is finished, and you can use the
* GetDeliverabilityTestReport
to view the results of the test.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deliverabilityTestStatus} will return {@link DeliverabilityTestStatus#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #deliverabilityTestStatusAsString}.
*
*
* @return The status of the predictive inbox placement test. If the status is IN_PROGRESS
, then the
* predictive inbox placement test is currently running. Predictive inbox placement tests are usually
* complete within 24 hours of creating the test. If the status is COMPLETE
, then the test is
* finished, and you can use the GetDeliverabilityTestReport
to view the results of the test.
* @see DeliverabilityTestStatus
*/
public final DeliverabilityTestStatus deliverabilityTestStatus() {
return DeliverabilityTestStatus.fromValue(deliverabilityTestStatus);
}
/**
*
* The status of the predictive inbox placement test. If the status is IN_PROGRESS
, then the predictive
* inbox placement test is currently running. Predictive inbox placement tests are usually complete within 24 hours
* of creating the test. If the status is COMPLETE
, then the test is finished, and you can use the
* GetDeliverabilityTestReport
to view the results of the test.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #deliverabilityTestStatus} will return {@link DeliverabilityTestStatus#UNKNOWN_TO_SDK_VERSION}. The raw
* value returned by the service is available from {@link #deliverabilityTestStatusAsString}.
*
*
* @return The status of the predictive inbox placement test. If the status is IN_PROGRESS
, then the
* predictive inbox placement test is currently running. Predictive inbox placement tests are usually
* complete within 24 hours of creating the test. If the status is COMPLETE
, then the test is
* finished, and you can use the GetDeliverabilityTestReport
to view the results of the test.
* @see DeliverabilityTestStatus
*/
public final String deliverabilityTestStatusAsString() {
return deliverabilityTestStatus;
}
@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 + Objects.hashCode(reportId());
hashCode = 31 * hashCode + Objects.hashCode(reportName());
hashCode = 31 * hashCode + Objects.hashCode(subject());
hashCode = 31 * hashCode + Objects.hashCode(fromEmailAddress());
hashCode = 31 * hashCode + Objects.hashCode(createDate());
hashCode = 31 * hashCode + Objects.hashCode(deliverabilityTestStatusAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeliverabilityTestReport)) {
return false;
}
DeliverabilityTestReport other = (DeliverabilityTestReport) obj;
return Objects.equals(reportId(), other.reportId()) && Objects.equals(reportName(), other.reportName())
&& Objects.equals(subject(), other.subject()) && Objects.equals(fromEmailAddress(), other.fromEmailAddress())
&& Objects.equals(createDate(), other.createDate())
&& Objects.equals(deliverabilityTestStatusAsString(), other.deliverabilityTestStatusAsString());
}
/**
* 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("DeliverabilityTestReport").add("ReportId", reportId()).add("ReportName", reportName())
.add("Subject", subject()).add("FromEmailAddress", fromEmailAddress()).add("CreateDate", createDate())
.add("DeliverabilityTestStatus", deliverabilityTestStatusAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReportId":
return Optional.ofNullable(clazz.cast(reportId()));
case "ReportName":
return Optional.ofNullable(clazz.cast(reportName()));
case "Subject":
return Optional.ofNullable(clazz.cast(subject()));
case "FromEmailAddress":
return Optional.ofNullable(clazz.cast(fromEmailAddress()));
case "CreateDate":
return Optional.ofNullable(clazz.cast(createDate()));
case "DeliverabilityTestStatus":
return Optional.ofNullable(clazz.cast(deliverabilityTestStatusAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function