software.amazon.awssdk.services.pinpoint.model.EmailChannelRequest Maven / Gradle / Ivy
Show all versions of pinpoint 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.pinpoint.model;
import java.io.Serializable;
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;
/**
*
* Specifies the status and settings of the email channel for an application.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class EmailChannelRequest implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CONFIGURATION_SET_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ConfigurationSet").getter(getter(EmailChannelRequest::configurationSet))
.setter(setter(Builder::configurationSet))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationSet").build()).build();
private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("Enabled").getter(getter(EmailChannelRequest::enabled)).setter(setter(Builder::enabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build();
private static final SdkField FROM_ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FromAddress").getter(getter(EmailChannelRequest::fromAddress)).setter(setter(Builder::fromAddress))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FromAddress").build()).build();
private static final SdkField IDENTITY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Identity").getter(getter(EmailChannelRequest::identity)).setter(setter(Builder::identity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Identity").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(EmailChannelRequest::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final SdkField ORCHESTRATION_SENDING_ROLE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("OrchestrationSendingRoleArn")
.getter(getter(EmailChannelRequest::orchestrationSendingRoleArn))
.setter(setter(Builder::orchestrationSendingRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OrchestrationSendingRoleArn")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONFIGURATION_SET_FIELD,
ENABLED_FIELD, FROM_ADDRESS_FIELD, IDENTITY_FIELD, ROLE_ARN_FIELD, ORCHESTRATION_SENDING_ROLE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String configurationSet;
private final Boolean enabled;
private final String fromAddress;
private final String identity;
private final String roleArn;
private final String orchestrationSendingRoleArn;
private EmailChannelRequest(BuilderImpl builder) {
this.configurationSet = builder.configurationSet;
this.enabled = builder.enabled;
this.fromAddress = builder.fromAddress;
this.identity = builder.identity;
this.roleArn = builder.roleArn;
this.orchestrationSendingRoleArn = builder.orchestrationSendingRoleArn;
}
/**
*
* The Amazon SES
* configuration set that you want to apply to messages that you send through the channel.
*
*
* @return The Amazon SES
* configuration set that you want to apply to messages that you send through the channel.
*/
public final String configurationSet() {
return configurationSet;
}
/**
*
* Specifies whether to enable the email channel for the application.
*
*
* @return Specifies whether to enable the email channel for the application.
*/
public final Boolean enabled() {
return enabled;
}
/**
*
* The verified email address that you want to send email from when you send email through the channel.
*
*
* @return
* The verified email address that you want to send email from when you send email through the channel.
*
*/
public final String fromAddress() {
return fromAddress;
}
/**
*
* The Amazon Resource Name (ARN) of the identity, verified with Amazon Simple Email Service (Amazon SES), that you
* want to use when you send email through the channel.
*
*
* @return
* The Amazon Resource Name (ARN) of the identity, verified with Amazon Simple Email Service (Amazon SES),
* that you want to use when you send email through the channel.
*
*/
public final String identity() {
return identity;
}
/**
*
* The ARN of the AWS Identity and Access Management (IAM) role that you want Amazon Pinpoint to use when it submits
* email-related event data for the channel.
*
*
* @return
* The ARN of the AWS Identity and Access Management (IAM) role that you want Amazon Pinpoint to use when it
* submits email-related event data for the channel.
*
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The ARN of an IAM role for Amazon Pinpoint to use to send email from your campaigns or journeys through Amazon
* SES.
*
*
* @return The ARN of an IAM role for Amazon Pinpoint to use to send email from your campaigns or journeys through
* Amazon SES.
*/
public final String orchestrationSendingRoleArn() {
return orchestrationSendingRoleArn;
}
@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(configurationSet());
hashCode = 31 * hashCode + Objects.hashCode(enabled());
hashCode = 31 * hashCode + Objects.hashCode(fromAddress());
hashCode = 31 * hashCode + Objects.hashCode(identity());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(orchestrationSendingRoleArn());
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 EmailChannelRequest)) {
return false;
}
EmailChannelRequest other = (EmailChannelRequest) obj;
return Objects.equals(configurationSet(), other.configurationSet()) && Objects.equals(enabled(), other.enabled())
&& Objects.equals(fromAddress(), other.fromAddress()) && Objects.equals(identity(), other.identity())
&& Objects.equals(roleArn(), other.roleArn())
&& Objects.equals(orchestrationSendingRoleArn(), other.orchestrationSendingRoleArn());
}
/**
* 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("EmailChannelRequest").add("ConfigurationSet", configurationSet()).add("Enabled", enabled())
.add("FromAddress", fromAddress()).add("Identity", identity()).add("RoleArn", roleArn())
.add("OrchestrationSendingRoleArn", orchestrationSendingRoleArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ConfigurationSet":
return Optional.ofNullable(clazz.cast(configurationSet()));
case "Enabled":
return Optional.ofNullable(clazz.cast(enabled()));
case "FromAddress":
return Optional.ofNullable(clazz.cast(fromAddress()));
case "Identity":
return Optional.ofNullable(clazz.cast(identity()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "OrchestrationSendingRoleArn":
return Optional.ofNullable(clazz.cast(orchestrationSendingRoleArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function