
software.amazon.awssdk.services.pinpointemail.model.PlacementStatistics 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.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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 inbox placement data for an email provider.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class PlacementStatistics implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField INBOX_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("InboxPercentage").getter(getter(PlacementStatistics::inboxPercentage))
.setter(setter(Builder::inboxPercentage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InboxPercentage").build()).build();
private static final SdkField SPAM_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("SpamPercentage").getter(getter(PlacementStatistics::spamPercentage))
.setter(setter(Builder::spamPercentage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SpamPercentage").build()).build();
private static final SdkField MISSING_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("MissingPercentage").getter(getter(PlacementStatistics::missingPercentage))
.setter(setter(Builder::missingPercentage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MissingPercentage").build()).build();
private static final SdkField SPF_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("SpfPercentage").getter(getter(PlacementStatistics::spfPercentage))
.setter(setter(Builder::spfPercentage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SpfPercentage").build()).build();
private static final SdkField DKIM_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("DkimPercentage").getter(getter(PlacementStatistics::dkimPercentage))
.setter(setter(Builder::dkimPercentage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DkimPercentage").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INBOX_PERCENTAGE_FIELD,
SPAM_PERCENTAGE_FIELD, MISSING_PERCENTAGE_FIELD, SPF_PERCENTAGE_FIELD, DKIM_PERCENTAGE_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("InboxPercentage", INBOX_PERCENTAGE_FIELD);
put("SpamPercentage", SPAM_PERCENTAGE_FIELD);
put("MissingPercentage", MISSING_PERCENTAGE_FIELD);
put("SpfPercentage", SPF_PERCENTAGE_FIELD);
put("DkimPercentage", DKIM_PERCENTAGE_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final Double inboxPercentage;
private final Double spamPercentage;
private final Double missingPercentage;
private final Double spfPercentage;
private final Double dkimPercentage;
private PlacementStatistics(BuilderImpl builder) {
this.inboxPercentage = builder.inboxPercentage;
this.spamPercentage = builder.spamPercentage;
this.missingPercentage = builder.missingPercentage;
this.spfPercentage = builder.spfPercentage;
this.dkimPercentage = builder.dkimPercentage;
}
/**
*
* The percentage of emails that arrived in recipients' inboxes during the predictive inbox placement test.
*
*
* @return The percentage of emails that arrived in recipients' inboxes during the predictive inbox placement test.
*/
public final Double inboxPercentage() {
return inboxPercentage;
}
/**
*
* The percentage of emails that arrived in recipients' spam or junk mail folders during the predictive inbox
* placement test.
*
*
* @return The percentage of emails that arrived in recipients' spam or junk mail folders during the predictive
* inbox placement test.
*/
public final Double spamPercentage() {
return spamPercentage;
}
/**
*
* The percentage of emails that didn't arrive in recipients' inboxes at all during the predictive inbox placement
* test.
*
*
* @return The percentage of emails that didn't arrive in recipients' inboxes at all during the predictive inbox
* placement test.
*/
public final Double missingPercentage() {
return missingPercentage;
}
/**
*
* The percentage of emails that were authenticated by using Sender Policy Framework (SPF) during the predictive
* inbox placement test.
*
*
* @return The percentage of emails that were authenticated by using Sender Policy Framework (SPF) during the
* predictive inbox placement test.
*/
public final Double spfPercentage() {
return spfPercentage;
}
/**
*
* The percentage of emails that were authenticated by using DomainKeys Identified Mail (DKIM) during the predictive
* inbox placement test.
*
*
* @return The percentage of emails that were authenticated by using DomainKeys Identified Mail (DKIM) during the
* predictive inbox placement test.
*/
public final Double dkimPercentage() {
return dkimPercentage;
}
@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(inboxPercentage());
hashCode = 31 * hashCode + Objects.hashCode(spamPercentage());
hashCode = 31 * hashCode + Objects.hashCode(missingPercentage());
hashCode = 31 * hashCode + Objects.hashCode(spfPercentage());
hashCode = 31 * hashCode + Objects.hashCode(dkimPercentage());
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 PlacementStatistics)) {
return false;
}
PlacementStatistics other = (PlacementStatistics) obj;
return Objects.equals(inboxPercentage(), other.inboxPercentage())
&& Objects.equals(spamPercentage(), other.spamPercentage())
&& Objects.equals(missingPercentage(), other.missingPercentage())
&& Objects.equals(spfPercentage(), other.spfPercentage())
&& Objects.equals(dkimPercentage(), other.dkimPercentage());
}
/**
* 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("PlacementStatistics").add("InboxPercentage", inboxPercentage())
.add("SpamPercentage", spamPercentage()).add("MissingPercentage", missingPercentage())
.add("SpfPercentage", spfPercentage()).add("DkimPercentage", dkimPercentage()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "InboxPercentage":
return Optional.ofNullable(clazz.cast(inboxPercentage()));
case "SpamPercentage":
return Optional.ofNullable(clazz.cast(spamPercentage()));
case "MissingPercentage":
return Optional.ofNullable(clazz.cast(missingPercentage()));
case "SpfPercentage":
return Optional.ofNullable(clazz.cast(spfPercentage()));
case "DkimPercentage":
return Optional.ofNullable(clazz.cast(dkimPercentage()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function