Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.Consumer;
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 message configuration settings for a campaign.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MessageConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ADM_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("ADMMessage").getter(getter(MessageConfiguration::admMessage)).setter(setter(Builder::admMessage))
.constructor(Message::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ADMMessage").build()).build();
private static final SdkField APNS_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("APNSMessage").getter(getter(MessageConfiguration::apnsMessage)).setter(setter(Builder::apnsMessage))
.constructor(Message::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("APNSMessage").build()).build();
private static final SdkField BAIDU_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("BaiduMessage").getter(getter(MessageConfiguration::baiduMessage)).setter(setter(Builder::baiduMessage))
.constructor(Message::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaiduMessage").build()).build();
private static final SdkField CUSTOM_MESSAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CustomMessage")
.getter(getter(MessageConfiguration::customMessage)).setter(setter(Builder::customMessage))
.constructor(CampaignCustomMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomMessage").build()).build();
private static final SdkField DEFAULT_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("DefaultMessage").getter(getter(MessageConfiguration::defaultMessage))
.setter(setter(Builder::defaultMessage)).constructor(Message::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultMessage").build()).build();
private static final SdkField EMAIL_MESSAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EmailMessage")
.getter(getter(MessageConfiguration::emailMessage)).setter(setter(Builder::emailMessage))
.constructor(CampaignEmailMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EmailMessage").build()).build();
private static final SdkField GCM_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("GCMMessage").getter(getter(MessageConfiguration::gcmMessage)).setter(setter(Builder::gcmMessage))
.constructor(Message::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GCMMessage").build()).build();
private static final SdkField SMS_MESSAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SMSMessage")
.getter(getter(MessageConfiguration::smsMessage)).setter(setter(Builder::smsMessage))
.constructor(CampaignSmsMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SMSMessage").build()).build();
private static final SdkField IN_APP_MESSAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("InAppMessage")
.getter(getter(MessageConfiguration::inAppMessage)).setter(setter(Builder::inAppMessage))
.constructor(CampaignInAppMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InAppMessage").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ADM_MESSAGE_FIELD,
APNS_MESSAGE_FIELD, BAIDU_MESSAGE_FIELD, CUSTOM_MESSAGE_FIELD, DEFAULT_MESSAGE_FIELD, EMAIL_MESSAGE_FIELD,
GCM_MESSAGE_FIELD, SMS_MESSAGE_FIELD, IN_APP_MESSAGE_FIELD));
private static final long serialVersionUID = 1L;
private final Message admMessage;
private final Message apnsMessage;
private final Message baiduMessage;
private final CampaignCustomMessage customMessage;
private final Message defaultMessage;
private final CampaignEmailMessage emailMessage;
private final Message gcmMessage;
private final CampaignSmsMessage smsMessage;
private final CampaignInAppMessage inAppMessage;
private MessageConfiguration(BuilderImpl builder) {
this.admMessage = builder.admMessage;
this.apnsMessage = builder.apnsMessage;
this.baiduMessage = builder.baiduMessage;
this.customMessage = builder.customMessage;
this.defaultMessage = builder.defaultMessage;
this.emailMessage = builder.emailMessage;
this.gcmMessage = builder.gcmMessage;
this.smsMessage = builder.smsMessage;
this.inAppMessage = builder.inAppMessage;
}
/**
*
* The message that the campaign sends through the ADM (Amazon Device Messaging) channel. If specified, this message
* overrides the default message.
*
*
* @return The message that the campaign sends through the ADM (Amazon Device Messaging) channel. If specified, this
* message overrides the default message.
*/
public final Message admMessage() {
return admMessage;
}
/**
*
* The message that the campaign sends through the APNs (Apple Push Notification service) channel. If specified,
* this message overrides the default message.
*
*
* @return The message that the campaign sends through the APNs (Apple Push Notification service) channel. If
* specified, this message overrides the default message.
*/
public final Message apnsMessage() {
return apnsMessage;
}
/**
*
* The message that the campaign sends through the Baidu (Baidu Cloud Push) channel. If specified, this message
* overrides the default message.
*
*
* @return The message that the campaign sends through the Baidu (Baidu Cloud Push) channel. If specified, this
* message overrides the default message.
*/
public final Message baiduMessage() {
return baiduMessage;
}
/**
*
* The message that the campaign sends through a custom channel, as specified by the delivery configuration
* (CustomDeliveryConfiguration) settings for the campaign. If specified, this message overrides the default
* message.
*
*
* @return The message that the campaign sends through a custom channel, as specified by the delivery configuration
* (CustomDeliveryConfiguration) settings for the campaign. If specified, this message overrides the default
* message.
*/
public final CampaignCustomMessage customMessage() {
return customMessage;
}
/**
*
* The default message that the campaign sends through all the channels that are configured for the campaign.
*
*
* @return The default message that the campaign sends through all the channels that are configured for the
* campaign.
*/
public final Message defaultMessage() {
return defaultMessage;
}
/**
*
* The message that the campaign sends through the email channel. If specified, this message overrides the default
* message.
*
*
* @return The message that the campaign sends through the email channel. If specified, this message overrides the
* default message.
*/
public final CampaignEmailMessage emailMessage() {
return emailMessage;
}
/**
*
* The message that the campaign sends through the GCM channel, which enables Amazon Pinpoint to send push
* notifications through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. If
* specified, this message overrides the default message.
*
*
* @return The message that the campaign sends through the GCM channel, which enables Amazon Pinpoint to send push
* notifications through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service.
* If specified, this message overrides the default message.
*/
public final Message gcmMessage() {
return gcmMessage;
}
/**
*
* The message that the campaign sends through the SMS channel. If specified, this message overrides the default
* message.
*
*
* @return The message that the campaign sends through the SMS channel. If specified, this message overrides the
* default message.
*/
public final CampaignSmsMessage smsMessage() {
return smsMessage;
}
/**
*
* The in-app message configuration.
*
*
* @return The in-app message configuration.
*/
public final CampaignInAppMessage inAppMessage() {
return inAppMessage;
}
@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(admMessage());
hashCode = 31 * hashCode + Objects.hashCode(apnsMessage());
hashCode = 31 * hashCode + Objects.hashCode(baiduMessage());
hashCode = 31 * hashCode + Objects.hashCode(customMessage());
hashCode = 31 * hashCode + Objects.hashCode(defaultMessage());
hashCode = 31 * hashCode + Objects.hashCode(emailMessage());
hashCode = 31 * hashCode + Objects.hashCode(gcmMessage());
hashCode = 31 * hashCode + Objects.hashCode(smsMessage());
hashCode = 31 * hashCode + Objects.hashCode(inAppMessage());
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 MessageConfiguration)) {
return false;
}
MessageConfiguration other = (MessageConfiguration) obj;
return Objects.equals(admMessage(), other.admMessage()) && Objects.equals(apnsMessage(), other.apnsMessage())
&& Objects.equals(baiduMessage(), other.baiduMessage()) && Objects.equals(customMessage(), other.customMessage())
&& Objects.equals(defaultMessage(), other.defaultMessage())
&& Objects.equals(emailMessage(), other.emailMessage()) && Objects.equals(gcmMessage(), other.gcmMessage())
&& Objects.equals(smsMessage(), other.smsMessage()) && Objects.equals(inAppMessage(), other.inAppMessage());
}
/**
* 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("MessageConfiguration").add("ADMMessage", admMessage()).add("APNSMessage", apnsMessage())
.add("BaiduMessage", baiduMessage()).add("CustomMessage", customMessage())
.add("DefaultMessage", defaultMessage()).add("EmailMessage", emailMessage()).add("GCMMessage", gcmMessage())
.add("SMSMessage", smsMessage()).add("InAppMessage", inAppMessage()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ADMMessage":
return Optional.ofNullable(clazz.cast(admMessage()));
case "APNSMessage":
return Optional.ofNullable(clazz.cast(apnsMessage()));
case "BaiduMessage":
return Optional.ofNullable(clazz.cast(baiduMessage()));
case "CustomMessage":
return Optional.ofNullable(clazz.cast(customMessage()));
case "DefaultMessage":
return Optional.ofNullable(clazz.cast(defaultMessage()));
case "EmailMessage":
return Optional.ofNullable(clazz.cast(emailMessage()));
case "GCMMessage":
return Optional.ofNullable(clazz.cast(gcmMessage()));
case "SMSMessage":
return Optional.ofNullable(clazz.cast(smsMessage()));
case "InAppMessage":
return Optional.ofNullable(clazz.cast(inAppMessage()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function