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.beans.Transient;
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 configuration and other settings for an activity in a journey.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Activity implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CUSTOM_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CUSTOM").getter(getter(Activity::custom))
.setter(setter(Builder::custom)).constructor(CustomMessageActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CUSTOM").build()).build();
private static final SdkField CONDITIONAL_SPLIT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ConditionalSplit")
.getter(getter(Activity::conditionalSplit)).setter(setter(Builder::conditionalSplit))
.constructor(ConditionalSplitActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConditionalSplit").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(Activity::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField EMAIL_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EMAIL").getter(getter(Activity::email))
.setter(setter(Builder::email)).constructor(EmailMessageActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EMAIL").build()).build();
private static final SdkField HOLDOUT_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Holdout").getter(getter(Activity::holdout)).setter(setter(Builder::holdout))
.constructor(HoldoutActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Holdout").build()).build();
private static final SdkField MULTI_CONDITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MultiCondition")
.getter(getter(Activity::multiCondition)).setter(setter(Builder::multiCondition))
.constructor(MultiConditionalSplitActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MultiCondition").build()).build();
private static final SdkField PUSH_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("PUSH").getter(getter(Activity::push))
.setter(setter(Builder::push)).constructor(PushMessageActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PUSH").build()).build();
private static final SdkField RANDOM_SPLIT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RandomSplit")
.getter(getter(Activity::randomSplit)).setter(setter(Builder::randomSplit)).constructor(RandomSplitActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RandomSplit").build()).build();
private static final SdkField SMS_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("SMS").getter(getter(Activity::sms)).setter(setter(Builder::sms))
.constructor(SMSMessageActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SMS").build()).build();
private static final SdkField WAIT_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Wait").getter(getter(Activity::waitValue)).setter(setter(Builder::waitValue))
.constructor(WaitActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Wait").build()).build();
private static final SdkField CONTACT_CENTER_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ContactCenter")
.getter(getter(Activity::contactCenter)).setter(setter(Builder::contactCenter))
.constructor(ContactCenterActivity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContactCenter").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CUSTOM_FIELD,
CONDITIONAL_SPLIT_FIELD, DESCRIPTION_FIELD, EMAIL_FIELD, HOLDOUT_FIELD, MULTI_CONDITION_FIELD, PUSH_FIELD,
RANDOM_SPLIT_FIELD, SMS_FIELD, WAIT_FIELD, CONTACT_CENTER_FIELD));
private static final long serialVersionUID = 1L;
private final CustomMessageActivity custom;
private final ConditionalSplitActivity conditionalSplit;
private final String description;
private final EmailMessageActivity email;
private final HoldoutActivity holdout;
private final MultiConditionalSplitActivity multiCondition;
private final PushMessageActivity push;
private final RandomSplitActivity randomSplit;
private final SMSMessageActivity sms;
private final WaitActivity wait;
private final ContactCenterActivity contactCenter;
private Activity(BuilderImpl builder) {
this.custom = builder.custom;
this.conditionalSplit = builder.conditionalSplit;
this.description = builder.description;
this.email = builder.email;
this.holdout = builder.holdout;
this.multiCondition = builder.multiCondition;
this.push = builder.push;
this.randomSplit = builder.randomSplit;
this.sms = builder.sms;
this.wait = builder.wait;
this.contactCenter = builder.contactCenter;
}
/**
*
* The settings for a custom message activity. This type of activity calls an AWS Lambda function or web hook that
* sends messages to participants.
*
*
* @return The settings for a custom message activity. This type of activity calls an AWS Lambda function or web
* hook that sends messages to participants.
*/
public final CustomMessageActivity custom() {
return custom;
}
/**
*
* The settings for a yes/no split activity. This type of activity sends participants down one of two paths in a
* journey, based on conditions that you specify.
*
*
* @return The settings for a yes/no split activity. This type of activity sends participants down one of two paths
* in a journey, based on conditions that you specify.
*/
public final ConditionalSplitActivity conditionalSplit() {
return conditionalSplit;
}
/**
*
* The custom description of the activity.
*
*
* @return The custom description of the activity.
*/
public final String description() {
return description;
}
/**
*
* The settings for an email activity. This type of activity sends an email message to participants.
*
*
* @return The settings for an email activity. This type of activity sends an email message to participants.
*/
public final EmailMessageActivity email() {
return email;
}
/**
*
* The settings for a holdout activity. This type of activity stops a journey for a specified percentage of
* participants.
*
*
* @return The settings for a holdout activity. This type of activity stops a journey for a specified percentage of
* participants.
*/
public final HoldoutActivity holdout() {
return holdout;
}
/**
*
* The settings for a multivariate split activity. This type of activity sends participants down one of as many as
* five paths (including a default Else path) in a journey, based on conditions that you specify.
*
*
* @return The settings for a multivariate split activity. This type of activity sends participants down one of as
* many as five paths (including a default Else path) in a journey, based on conditions that you
* specify.
*/
public final MultiConditionalSplitActivity multiCondition() {
return multiCondition;
}
/**
*
* The settings for a push notification activity. This type of activity sends a push notification to participants.
*
*
* @return The settings for a push notification activity. This type of activity sends a push notification to
* participants.
*/
public final PushMessageActivity push() {
return push;
}
/**
*
* The settings for a random split activity. This type of activity randomly sends specified percentages of
* participants down one of as many as five paths in a journey, based on conditions that you specify.
*
*
* @return The settings for a random split activity. This type of activity randomly sends specified percentages of
* participants down one of as many as five paths in a journey, based on conditions that you specify.
*/
public final RandomSplitActivity randomSplit() {
return randomSplit;
}
/**
*
* The settings for an SMS activity. This type of activity sends a text message to participants.
*
*
* @return The settings for an SMS activity. This type of activity sends a text message to participants.
*/
public final SMSMessageActivity sms() {
return sms;
}
/**
*
* The settings for a wait activity. This type of activity waits for a certain amount of time or until a specific
* date and time before moving participants to the next activity in a journey.
*
*
* @return The settings for a wait activity. This type of activity waits for a certain amount of time or until a
* specific date and time before moving participants to the next activity in a journey.
*/
public final WaitActivity waitValue() {
return wait;
}
/**
*
* The settings for a connect activity. This type of activity initiates a contact center call to participants.
*
*
* @return The settings for a connect activity. This type of activity initiates a contact center call to
* participants.
*/
public final ContactCenterActivity contactCenter() {
return contactCenter;
}
@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(custom());
hashCode = 31 * hashCode + Objects.hashCode(conditionalSplit());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(email());
hashCode = 31 * hashCode + Objects.hashCode(holdout());
hashCode = 31 * hashCode + Objects.hashCode(multiCondition());
hashCode = 31 * hashCode + Objects.hashCode(push());
hashCode = 31 * hashCode + Objects.hashCode(randomSplit());
hashCode = 31 * hashCode + Objects.hashCode(sms());
hashCode = 31 * hashCode + Objects.hashCode(waitValue());
hashCode = 31 * hashCode + Objects.hashCode(contactCenter());
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 Activity)) {
return false;
}
Activity other = (Activity) obj;
return Objects.equals(custom(), other.custom()) && Objects.equals(conditionalSplit(), other.conditionalSplit())
&& Objects.equals(description(), other.description()) && Objects.equals(email(), other.email())
&& Objects.equals(holdout(), other.holdout()) && Objects.equals(multiCondition(), other.multiCondition())
&& Objects.equals(push(), other.push()) && Objects.equals(randomSplit(), other.randomSplit())
&& Objects.equals(sms(), other.sms()) && Objects.equals(waitValue(), other.waitValue())
&& Objects.equals(contactCenter(), other.contactCenter());
}
/**
* 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("Activity").add("CUSTOM", custom()).add("ConditionalSplit", conditionalSplit())
.add("Description", description()).add("EMAIL", email()).add("Holdout", holdout())
.add("MultiCondition", multiCondition()).add("PUSH", push()).add("RandomSplit", randomSplit()).add("SMS", sms())
.add("Wait", waitValue()).add("ContactCenter", contactCenter()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CUSTOM":
return Optional.ofNullable(clazz.cast(custom()));
case "ConditionalSplit":
return Optional.ofNullable(clazz.cast(conditionalSplit()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "EMAIL":
return Optional.ofNullable(clazz.cast(email()));
case "Holdout":
return Optional.ofNullable(clazz.cast(holdout()));
case "MultiCondition":
return Optional.ofNullable(clazz.cast(multiCondition()));
case "PUSH":
return Optional.ofNullable(clazz.cast(push()));
case "RandomSplit":
return Optional.ofNullable(clazz.cast(randomSplit()));
case "SMS":
return Optional.ofNullable(clazz.cast(sms()));
case "Wait":
return Optional.ofNullable(clazz.cast(waitValue()));
case "ContactCenter":
return Optional.ofNullable(clazz.cast(contactCenter()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function