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 settings and content for the default message and any default messages that you tailored for specific
* channels.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DirectMessageConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ADM_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("ADMMessage").getter(getter(DirectMessageConfiguration::admMessage)).setter(setter(Builder::admMessage))
.constructor(ADMMessage::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(DirectMessageConfiguration::apnsMessage))
.setter(setter(Builder::apnsMessage)).constructor(APNSMessage::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(DirectMessageConfiguration::baiduMessage))
.setter(setter(Builder::baiduMessage)).constructor(BaiduMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaiduMessage").build()).build();
private static final SdkField DEFAULT_MESSAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DefaultMessage")
.getter(getter(DirectMessageConfiguration::defaultMessage)).setter(setter(Builder::defaultMessage))
.constructor(DefaultMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultMessage").build()).build();
private static final SdkField DEFAULT_PUSH_NOTIFICATION_MESSAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("DefaultPushNotificationMessage")
.getter(getter(DirectMessageConfiguration::defaultPushNotificationMessage))
.setter(setter(Builder::defaultPushNotificationMessage))
.constructor(DefaultPushNotificationMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultPushNotificationMessage")
.build()).build();
private static final SdkField EMAIL_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("EmailMessage").getter(getter(DirectMessageConfiguration::emailMessage))
.setter(setter(Builder::emailMessage)).constructor(EmailMessage::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(DirectMessageConfiguration::gcmMessage)).setter(setter(Builder::gcmMessage))
.constructor(GCMMessage::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(DirectMessageConfiguration::smsMessage)).setter(setter(Builder::smsMessage))
.constructor(SMSMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SMSMessage").build()).build();
private static final SdkField VOICE_MESSAGE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("VoiceMessage").getter(getter(DirectMessageConfiguration::voiceMessage))
.setter(setter(Builder::voiceMessage)).constructor(VoiceMessage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VoiceMessage").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ADM_MESSAGE_FIELD,
APNS_MESSAGE_FIELD, BAIDU_MESSAGE_FIELD, DEFAULT_MESSAGE_FIELD, DEFAULT_PUSH_NOTIFICATION_MESSAGE_FIELD,
EMAIL_MESSAGE_FIELD, GCM_MESSAGE_FIELD, SMS_MESSAGE_FIELD, VOICE_MESSAGE_FIELD));
private static final long serialVersionUID = 1L;
private final ADMMessage admMessage;
private final APNSMessage apnsMessage;
private final BaiduMessage baiduMessage;
private final DefaultMessage defaultMessage;
private final DefaultPushNotificationMessage defaultPushNotificationMessage;
private final EmailMessage emailMessage;
private final GCMMessage gcmMessage;
private final SMSMessage smsMessage;
private final VoiceMessage voiceMessage;
private DirectMessageConfiguration(BuilderImpl builder) {
this.admMessage = builder.admMessage;
this.apnsMessage = builder.apnsMessage;
this.baiduMessage = builder.baiduMessage;
this.defaultMessage = builder.defaultMessage;
this.defaultPushNotificationMessage = builder.defaultPushNotificationMessage;
this.emailMessage = builder.emailMessage;
this.gcmMessage = builder.gcmMessage;
this.smsMessage = builder.smsMessage;
this.voiceMessage = builder.voiceMessage;
}
/**
*
* The default push notification message for the ADM (Amazon Device Messaging) channel. This message overrides the
* default push notification message (DefaultPushNotificationMessage).
*
*
* @return The default push notification message for the ADM (Amazon Device Messaging) channel. This message
* overrides the default push notification message (DefaultPushNotificationMessage).
*/
public final ADMMessage admMessage() {
return admMessage;
}
/**
*
* The default push notification message for the APNs (Apple Push Notification service) channel. This message
* overrides the default push notification message (DefaultPushNotificationMessage).
*
*
* @return The default push notification message for the APNs (Apple Push Notification service) channel. This
* message overrides the default push notification message (DefaultPushNotificationMessage).
*/
public final APNSMessage apnsMessage() {
return apnsMessage;
}
/**
*
* The default push notification message for the Baidu (Baidu Cloud Push) channel. This message overrides the
* default push notification message (DefaultPushNotificationMessage).
*
*
* @return The default push notification message for the Baidu (Baidu Cloud Push) channel. This message overrides
* the default push notification message (DefaultPushNotificationMessage).
*/
public final BaiduMessage baiduMessage() {
return baiduMessage;
}
/**
*
* The default message for all channels.
*
*
* @return The default message for all channels.
*/
public final DefaultMessage defaultMessage() {
return defaultMessage;
}
/**
*
* The default push notification message for all push notification channels.
*
*
* @return The default push notification message for all push notification channels.
*/
public final DefaultPushNotificationMessage defaultPushNotificationMessage() {
return defaultPushNotificationMessage;
}
/**
*
* The default message for the email channel. This message overrides the default message (DefaultMessage).
*
*
* @return The default message for the email channel. This message overrides the default message (DefaultMessage).
*/
public final EmailMessage emailMessage() {
return emailMessage;
}
/**
*
* The default push notification message for the GCM channel, which is used to send notifications through the
* Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message overrides the
* default push notification message (DefaultPushNotificationMessage).
*
*
* @return The default push notification message for the GCM channel, which is used to send notifications through
* the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. This message
* overrides the default push notification message (DefaultPushNotificationMessage).
*/
public final GCMMessage gcmMessage() {
return gcmMessage;
}
/**
*
* The default message for the SMS channel. This message overrides the default message (DefaultMessage).
*
*
* @return The default message for the SMS channel. This message overrides the default message (DefaultMessage).
*/
public final SMSMessage smsMessage() {
return smsMessage;
}
/**
*
* The default message for the voice channel. This message overrides the default message (DefaultMessage).
*
*
* @return The default message for the voice channel. This message overrides the default message (DefaultMessage).
*/
public final VoiceMessage voiceMessage() {
return voiceMessage;
}
@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(defaultMessage());
hashCode = 31 * hashCode + Objects.hashCode(defaultPushNotificationMessage());
hashCode = 31 * hashCode + Objects.hashCode(emailMessage());
hashCode = 31 * hashCode + Objects.hashCode(gcmMessage());
hashCode = 31 * hashCode + Objects.hashCode(smsMessage());
hashCode = 31 * hashCode + Objects.hashCode(voiceMessage());
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 DirectMessageConfiguration)) {
return false;
}
DirectMessageConfiguration other = (DirectMessageConfiguration) obj;
return Objects.equals(admMessage(), other.admMessage()) && Objects.equals(apnsMessage(), other.apnsMessage())
&& Objects.equals(baiduMessage(), other.baiduMessage())
&& Objects.equals(defaultMessage(), other.defaultMessage())
&& Objects.equals(defaultPushNotificationMessage(), other.defaultPushNotificationMessage())
&& Objects.equals(emailMessage(), other.emailMessage()) && Objects.equals(gcmMessage(), other.gcmMessage())
&& Objects.equals(smsMessage(), other.smsMessage()) && Objects.equals(voiceMessage(), other.voiceMessage());
}
/**
* 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("DirectMessageConfiguration").add("ADMMessage", admMessage()).add("APNSMessage", apnsMessage())
.add("BaiduMessage", baiduMessage()).add("DefaultMessage", defaultMessage())
.add("DefaultPushNotificationMessage", defaultPushNotificationMessage()).add("EmailMessage", emailMessage())
.add("GCMMessage", gcmMessage()).add("SMSMessage", smsMessage()).add("VoiceMessage", voiceMessage()).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 "DefaultMessage":
return Optional.ofNullable(clazz.cast(defaultMessage()));
case "DefaultPushNotificationMessage":
return Optional.ofNullable(clazz.cast(defaultPushNotificationMessage()));
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 "VoiceMessage":
return Optional.ofNullable(clazz.cast(voiceMessage()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function