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

software.amazon.awssdk.services.pinpointemail.model.GetEmailIdentityResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Pinpoint Email module holds the client classes that are used for communicating with Pinpoint Email.

There is a newer version: 2.29.17
Show newest version
/*
 * 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.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.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;

/**
 * 

* Details about an email identity. *

*/ @Generated("software.amazon.awssdk:codegen") public final class GetEmailIdentityResponse extends PinpointEmailResponse implements ToCopyableBuilder { private static final SdkField IDENTITY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("IdentityType").getter(getter(GetEmailIdentityResponse::identityTypeAsString)) .setter(setter(Builder::identityType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityType").build()).build(); private static final SdkField FEEDBACK_FORWARDING_STATUS_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("FeedbackForwardingStatus").getter(getter(GetEmailIdentityResponse::feedbackForwardingStatus)) .setter(setter(Builder::feedbackForwardingStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeedbackForwardingStatus").build()) .build(); private static final SdkField VERIFIED_FOR_SENDING_STATUS_FIELD = SdkField . builder(MarshallingType.BOOLEAN).memberName("VerifiedForSendingStatus") .getter(getter(GetEmailIdentityResponse::verifiedForSendingStatus)).setter(setter(Builder::verifiedForSendingStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VerifiedForSendingStatus").build()) .build(); private static final SdkField DKIM_ATTRIBUTES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DkimAttributes") .getter(getter(GetEmailIdentityResponse::dkimAttributes)).setter(setter(Builder::dkimAttributes)) .constructor(DkimAttributes::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DkimAttributes").build()).build(); private static final SdkField MAIL_FROM_ATTRIBUTES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("MailFromAttributes") .getter(getter(GetEmailIdentityResponse::mailFromAttributes)).setter(setter(Builder::mailFromAttributes)) .constructor(MailFromAttributes::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MailFromAttributes").build()) .build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Tags") .getter(getter(GetEmailIdentityResponse::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IDENTITY_TYPE_FIELD, FEEDBACK_FORWARDING_STATUS_FIELD, VERIFIED_FOR_SENDING_STATUS_FIELD, DKIM_ATTRIBUTES_FIELD, MAIL_FROM_ATTRIBUTES_FIELD, TAGS_FIELD)); private final String identityType; private final Boolean feedbackForwardingStatus; private final Boolean verifiedForSendingStatus; private final DkimAttributes dkimAttributes; private final MailFromAttributes mailFromAttributes; private final List tags; private GetEmailIdentityResponse(BuilderImpl builder) { super(builder); this.identityType = builder.identityType; this.feedbackForwardingStatus = builder.feedbackForwardingStatus; this.verifiedForSendingStatus = builder.verifiedForSendingStatus; this.dkimAttributes = builder.dkimAttributes; this.mailFromAttributes = builder.mailFromAttributes; this.tags = builder.tags; } /** *

* The email identity type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #identityType} will * return {@link IdentityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #identityTypeAsString}. *

* * @return The email identity type. * @see IdentityType */ public final IdentityType identityType() { return IdentityType.fromValue(identityType); } /** *

* The email identity type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #identityType} will * return {@link IdentityType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #identityTypeAsString}. *

* * @return The email identity type. * @see IdentityType */ public final String identityTypeAsString() { return identityType; } /** *

* The feedback forwarding configuration for the identity. *

*

* If the value is true, Amazon Pinpoint sends you email notifications when bounce or complaint events * occur. Amazon Pinpoint sends this notification to the address that you specified in the Return-Path header of the * original email. *

*

* When you set this value to false, Amazon Pinpoint sends notifications through other mechanisms, such * as by notifying an Amazon SNS topic or another event destination. You're required to have a method of tracking * bounces and complaints. If you haven't set up another mechanism for receiving bounce or complaint notifications, * Amazon Pinpoint sends an email notification when these events occur (even if this setting is disabled). *

* * @return The feedback forwarding configuration for the identity.

*

* If the value is true, Amazon Pinpoint sends you email notifications when bounce or complaint * events occur. Amazon Pinpoint sends this notification to the address that you specified in the * Return-Path header of the original email. *

*

* When you set this value to false, Amazon Pinpoint sends notifications through other * mechanisms, such as by notifying an Amazon SNS topic or another event destination. You're required to * have a method of tracking bounces and complaints. If you haven't set up another mechanism for receiving * bounce or complaint notifications, Amazon Pinpoint sends an email notification when these events occur * (even if this setting is disabled). */ public final Boolean feedbackForwardingStatus() { return feedbackForwardingStatus; } /** *

* Specifies whether or not the identity is verified. In Amazon Pinpoint, you can only send email from verified * email addresses or domains. For more information about verifying identities, see the Amazon Pinpoint * User Guide. *

* * @return Specifies whether or not the identity is verified. In Amazon Pinpoint, you can only send email from * verified email addresses or domains. For more information about verifying identities, see the Amazon * Pinpoint User Guide. */ public final Boolean verifiedForSendingStatus() { return verifiedForSendingStatus; } /** *

* An object that contains information about the DKIM attributes for the identity. This object includes the tokens * that you use to create the CNAME records that are required to complete the DKIM verification process. *

* * @return An object that contains information about the DKIM attributes for the identity. This object includes the * tokens that you use to create the CNAME records that are required to complete the DKIM verification * process. */ public final DkimAttributes dkimAttributes() { return dkimAttributes; } /** *

* An object that contains information about the Mail-From attributes for the email identity. *

* * @return An object that contains information about the Mail-From attributes for the email identity. */ public final MailFromAttributes mailFromAttributes() { return mailFromAttributes; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* An array of objects that define the tags (keys and values) that are associated with the email identity. *

*

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

* * @return An array of objects that define the tags (keys and values) that are associated with the email identity. */ public final List tags() { return tags; } @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(identityTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(feedbackForwardingStatus()); hashCode = 31 * hashCode + Objects.hashCode(verifiedForSendingStatus()); hashCode = 31 * hashCode + Objects.hashCode(dkimAttributes()); hashCode = 31 * hashCode + Objects.hashCode(mailFromAttributes()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : 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 GetEmailIdentityResponse)) { return false; } GetEmailIdentityResponse other = (GetEmailIdentityResponse) obj; return Objects.equals(identityTypeAsString(), other.identityTypeAsString()) && Objects.equals(feedbackForwardingStatus(), other.feedbackForwardingStatus()) && Objects.equals(verifiedForSendingStatus(), other.verifiedForSendingStatus()) && Objects.equals(dkimAttributes(), other.dkimAttributes()) && Objects.equals(mailFromAttributes(), other.mailFromAttributes()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * 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("GetEmailIdentityResponse").add("IdentityType", identityTypeAsString()) .add("FeedbackForwardingStatus", feedbackForwardingStatus()) .add("VerifiedForSendingStatus", verifiedForSendingStatus()).add("DkimAttributes", dkimAttributes()) .add("MailFromAttributes", mailFromAttributes()).add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "IdentityType": return Optional.ofNullable(clazz.cast(identityTypeAsString())); case "FeedbackForwardingStatus": return Optional.ofNullable(clazz.cast(feedbackForwardingStatus())); case "VerifiedForSendingStatus": return Optional.ofNullable(clazz.cast(verifiedForSendingStatus())); case "DkimAttributes": return Optional.ofNullable(clazz.cast(dkimAttributes())); case "MailFromAttributes": return Optional.ofNullable(clazz.cast(mailFromAttributes())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetEmailIdentityResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends PinpointEmailResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The email identity type. *

* * @param identityType * The email identity type. * @see IdentityType * @return Returns a reference to this object so that method calls can be chained together. * @see IdentityType */ Builder identityType(String identityType); /** *

* The email identity type. *

* * @param identityType * The email identity type. * @see IdentityType * @return Returns a reference to this object so that method calls can be chained together. * @see IdentityType */ Builder identityType(IdentityType identityType); /** *

* The feedback forwarding configuration for the identity. *

*

* If the value is true, Amazon Pinpoint sends you email notifications when bounce or complaint * events occur. Amazon Pinpoint sends this notification to the address that you specified in the Return-Path * header of the original email. *

*

* When you set this value to false, Amazon Pinpoint sends notifications through other mechanisms, * such as by notifying an Amazon SNS topic or another event destination. You're required to have a method of * tracking bounces and complaints. If you haven't set up another mechanism for receiving bounce or complaint * notifications, Amazon Pinpoint sends an email notification when these events occur (even if this setting is * disabled). *

* * @param feedbackForwardingStatus * The feedback forwarding configuration for the identity.

*

* If the value is true, Amazon Pinpoint sends you email notifications when bounce or * complaint events occur. Amazon Pinpoint sends this notification to the address that you specified in * the Return-Path header of the original email. *

*

* When you set this value to false, Amazon Pinpoint sends notifications through other * mechanisms, such as by notifying an Amazon SNS topic or another event destination. You're required to * have a method of tracking bounces and complaints. If you haven't set up another mechanism for * receiving bounce or complaint notifications, Amazon Pinpoint sends an email notification when these * events occur (even if this setting is disabled). * @return Returns a reference to this object so that method calls can be chained together. */ Builder feedbackForwardingStatus(Boolean feedbackForwardingStatus); /** *

* Specifies whether or not the identity is verified. In Amazon Pinpoint, you can only send email from verified * email addresses or domains. For more information about verifying identities, see the Amazon * Pinpoint User Guide. *

* * @param verifiedForSendingStatus * Specifies whether or not the identity is verified. In Amazon Pinpoint, you can only send email from * verified email addresses or domains. For more information about verifying identities, see the Amazon * Pinpoint User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder verifiedForSendingStatus(Boolean verifiedForSendingStatus); /** *

* An object that contains information about the DKIM attributes for the identity. This object includes the * tokens that you use to create the CNAME records that are required to complete the DKIM verification process. *

* * @param dkimAttributes * An object that contains information about the DKIM attributes for the identity. This object includes * the tokens that you use to create the CNAME records that are required to complete the DKIM * verification process. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dkimAttributes(DkimAttributes dkimAttributes); /** *

* An object that contains information about the DKIM attributes for the identity. This object includes the * tokens that you use to create the CNAME records that are required to complete the DKIM verification process. *

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

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

* An object that contains information about the Mail-From attributes for the email identity. *

* * @param mailFromAttributes * An object that contains information about the Mail-From attributes for the email identity. * @return Returns a reference to this object so that method calls can be chained together. */ Builder mailFromAttributes(MailFromAttributes mailFromAttributes); /** *

* An object that contains information about the Mail-From attributes for the email identity. *

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

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

* An array of objects that define the tags (keys and values) that are associated with the email identity. *

* * @param tags * An array of objects that define the tags (keys and values) that are associated with the email * identity. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* An array of objects that define the tags (keys and values) that are associated with the email identity. *

* * @param tags * An array of objects that define the tags (keys and values) that are associated with the email * identity. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* An array of objects that define the tags (keys and values) that are associated with the email identity. *

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

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.pinpointemail.model.Tag.Builder#build()} is called immediately and its * result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on * {@link software.amazon.awssdk.services.pinpointemail.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); } static final class BuilderImpl extends PinpointEmailResponse.BuilderImpl implements Builder { private String identityType; private Boolean feedbackForwardingStatus; private Boolean verifiedForSendingStatus; private DkimAttributes dkimAttributes; private MailFromAttributes mailFromAttributes; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(GetEmailIdentityResponse model) { super(model); identityType(model.identityType); feedbackForwardingStatus(model.feedbackForwardingStatus); verifiedForSendingStatus(model.verifiedForSendingStatus); dkimAttributes(model.dkimAttributes); mailFromAttributes(model.mailFromAttributes); tags(model.tags); } public final String getIdentityType() { return identityType; } public final void setIdentityType(String identityType) { this.identityType = identityType; } @Override public final Builder identityType(String identityType) { this.identityType = identityType; return this; } @Override public final Builder identityType(IdentityType identityType) { this.identityType(identityType == null ? null : identityType.toString()); return this; } public final Boolean getFeedbackForwardingStatus() { return feedbackForwardingStatus; } public final void setFeedbackForwardingStatus(Boolean feedbackForwardingStatus) { this.feedbackForwardingStatus = feedbackForwardingStatus; } @Override public final Builder feedbackForwardingStatus(Boolean feedbackForwardingStatus) { this.feedbackForwardingStatus = feedbackForwardingStatus; return this; } public final Boolean getVerifiedForSendingStatus() { return verifiedForSendingStatus; } public final void setVerifiedForSendingStatus(Boolean verifiedForSendingStatus) { this.verifiedForSendingStatus = verifiedForSendingStatus; } @Override public final Builder verifiedForSendingStatus(Boolean verifiedForSendingStatus) { this.verifiedForSendingStatus = verifiedForSendingStatus; return this; } public final DkimAttributes.Builder getDkimAttributes() { return dkimAttributes != null ? dkimAttributes.toBuilder() : null; } public final void setDkimAttributes(DkimAttributes.BuilderImpl dkimAttributes) { this.dkimAttributes = dkimAttributes != null ? dkimAttributes.build() : null; } @Override public final Builder dkimAttributes(DkimAttributes dkimAttributes) { this.dkimAttributes = dkimAttributes; return this; } public final MailFromAttributes.Builder getMailFromAttributes() { return mailFromAttributes != null ? mailFromAttributes.toBuilder() : null; } public final void setMailFromAttributes(MailFromAttributes.BuilderImpl mailFromAttributes) { this.mailFromAttributes = mailFromAttributes != null ? mailFromAttributes.build() : null; } @Override public final Builder mailFromAttributes(MailFromAttributes mailFromAttributes) { this.mailFromAttributes = mailFromAttributes; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } @Override public GetEmailIdentityResponse build() { return new GetEmailIdentityResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy