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

software.amazon.awssdk.services.pinpoint.model.JourneyResponse Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 2014-2019 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.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.utils.CollectionUtils;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Provides information about the status, configuration, and other settings for a journey. *

*/ @Generated("software.amazon.awssdk:codegen") public final class JourneyResponse implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField> ACTIVITIES_FIELD = SdkField .> builder(MarshallingType.MAP) .getter(getter(JourneyResponse::activities)) .setter(setter(Builder::activities)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Activities").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Activity::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::applicationId)).setter(setter(Builder::applicationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationId").build()).build(); private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::creationDate)).setter(setter(Builder::creationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build(); private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::lastModifiedDate)).setter(setter(Builder::lastModifiedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedDate").build()).build(); private static final SdkField LIMITS_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .getter(getter(JourneyResponse::limits)).setter(setter(Builder::limits)).constructor(JourneyLimits::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Limits").build()).build(); private static final SdkField LOCAL_TIME_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(JourneyResponse::localTime)).setter(setter(Builder::localTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocalTime").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField QUIET_TIME_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .getter(getter(JourneyResponse::quietTime)).setter(setter(Builder::quietTime)).constructor(QuietTime::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuietTime").build()).build(); private static final SdkField REFRESH_FREQUENCY_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::refreshFrequency)).setter(setter(Builder::refreshFrequency)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RefreshFrequency").build()).build(); private static final SdkField SCHEDULE_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .getter(getter(JourneyResponse::schedule)).setter(setter(Builder::schedule)).constructor(JourneySchedule::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Schedule").build()).build(); private static final SdkField START_ACTIVITY_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::startActivity)).setter(setter(Builder::startActivity)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartActivity").build()).build(); private static final SdkField START_CONDITION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).getter(getter(JourneyResponse::startCondition)) .setter(setter(Builder::startCondition)).constructor(StartCondition::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartCondition").build()).build(); private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(JourneyResponse::stateAsString)).setter(setter(Builder::state)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .getter(getter(JourneyResponse::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTIVITIES_FIELD, APPLICATION_ID_FIELD, CREATION_DATE_FIELD, ID_FIELD, LAST_MODIFIED_DATE_FIELD, LIMITS_FIELD, LOCAL_TIME_FIELD, NAME_FIELD, QUIET_TIME_FIELD, REFRESH_FREQUENCY_FIELD, SCHEDULE_FIELD, START_ACTIVITY_FIELD, START_CONDITION_FIELD, STATE_FIELD, TAGS_FIELD)); private static final long serialVersionUID = 1L; private final Map activities; private final String applicationId; private final String creationDate; private final String id; private final String lastModifiedDate; private final JourneyLimits limits; private final Boolean localTime; private final String name; private final QuietTime quietTime; private final String refreshFrequency; private final JourneySchedule schedule; private final String startActivity; private final StartCondition startCondition; private final String state; private final Map tags; private JourneyResponse(BuilderImpl builder) { this.activities = builder.activities; this.applicationId = builder.applicationId; this.creationDate = builder.creationDate; this.id = builder.id; this.lastModifiedDate = builder.lastModifiedDate; this.limits = builder.limits; this.localTime = builder.localTime; this.name = builder.name; this.quietTime = builder.quietTime; this.refreshFrequency = builder.refreshFrequency; this.schedule = builder.schedule; this.startActivity = builder.startActivity; this.startCondition = builder.startCondition; this.state = builder.state; this.tags = builder.tags; } /** *

* The configuration and other settings for the activities that comprise the journey. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

* * @return The configuration and other settings for the activities that comprise the journey. */ public Map activities() { return activities; } /** *

* The unique identifier for the application that the journey applies to. *

* * @return The unique identifier for the application that the journey applies to. */ public String applicationId() { return applicationId; } /** *

* The date, in ISO 8601 format, when the journey was created. *

* * @return The date, in ISO 8601 format, when the journey was created. */ public String creationDate() { return creationDate; } /** *

* The unique identifier for the journey. *

* * @return The unique identifier for the journey. */ public String id() { return id; } /** *

* The date, in ISO 8601 format, when the journey was last modified. *

* * @return The date, in ISO 8601 format, when the journey was last modified. */ public String lastModifiedDate() { return lastModifiedDate; } /** *

* The messaging and entry limits for the journey. *

* * @return The messaging and entry limits for the journey. */ public JourneyLimits limits() { return limits; } /** *

* Specifies whether the journey's scheduled start and end times use each participant's local time. If this value is * true, the schedule uses each participant's local time. *

* * @return Specifies whether the journey's scheduled start and end times use each participant's local time. If this * value is true, the schedule uses each participant's local time. */ public Boolean localTime() { return localTime; } /** *

* The name of the journey. *

* * @return The name of the journey. */ public String name() { return name; } /** *

* The quiet time settings for the journey. Quiet time is a specific time range when a journey doesn't send messages * to participants, if all the following conditions are met: *

*
    *
  • *

    * The EndpointDemographic.Timezone property of the endpoint for the participant is set to a valid value. *

    *
  • *
  • *

    * The current time in the participant's time zone is later than or equal to the time specified by the * QuietTime.Start property for the journey. *

    *
  • *
  • *

    * The current time in the participant's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the journey. *

    *
  • *
*

* If any of the preceding conditions isn't met, the participant will receive messages from the journey, even if * quiet time is enabled. *

* * @return The quiet time settings for the journey. Quiet time is a specific time range when a journey doesn't send * messages to participants, if all the following conditions are met:

*
    *
  • *

    * The EndpointDemographic.Timezone property of the endpoint for the participant is set to a valid value. *

    *
  • *
  • *

    * The current time in the participant's time zone is later than or equal to the time specified by the * QuietTime.Start property for the journey. *

    *
  • *
  • *

    * The current time in the participant's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the journey. *

    *
  • *
*

* If any of the preceding conditions isn't met, the participant will receive messages from the journey, * even if quiet time is enabled. */ public QuietTime quietTime() { return quietTime; } /** *

* The frequency with which Amazon Pinpoint evaluates segment and event data for the journey, as a duration in ISO * 8601 format. *

* * @return The frequency with which Amazon Pinpoint evaluates segment and event data for the journey, as a duration * in ISO 8601 format. */ public String refreshFrequency() { return refreshFrequency; } /** *

* The schedule settings for the journey. *

* * @return The schedule settings for the journey. */ public JourneySchedule schedule() { return schedule; } /** *

* The unique identifier for the first activity in the journey. *

* * @return The unique identifier for the first activity in the journey. */ public String startActivity() { return startActivity; } /** *

* The segment that defines which users are participants in the journey. *

* * @return The segment that defines which users are participants in the journey. */ public StartCondition startCondition() { return startCondition; } /** *

* The current status of the journey. Possible values are: *

*
    *
  • *

    * DRAFT - The journey is being developed and hasn't been published yet. *

    *
  • *
  • *

    * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the journey may * currently be running or scheduled to start running at a later time. If a journey's status is ACTIVE, you can't * add, change, or remove activities from it. *

    *
  • *
  • *

    * COMPLETED - The journey has been published and has finished running. All participants have entered the journey * and no participants are waiting to complete the journey or any activities in the journey. *

    *
  • *
  • *

    * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, or remove * activities or segment settings from the journey. *

    *
  • *
  • *

    * CLOSED - The journey has been published and has started running. It may have also passed its scheduled end time, * or passed its scheduled start time and a refresh frequency hasn't been specified for it. If a journey's status is * CLOSED, you can't add participants to it, and no existing participants can enter the journey for the first time. * However, any existing participants who are currently waiting to start an activity may resume the journey. *

    *
  • *
*

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

* * @return The current status of the journey. Possible values are:

*
    *
  • *

    * DRAFT - The journey is being developed and hasn't been published yet. *

    *
  • *
  • *

    * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the journey * may currently be running or scheduled to start running at a later time. If a journey's status is ACTIVE, * you can't add, change, or remove activities from it. *

    *
  • *
  • *

    * COMPLETED - The journey has been published and has finished running. All participants have entered the * journey and no participants are waiting to complete the journey or any activities in the journey. *

    *
  • *
  • *

    * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, or * remove activities or segment settings from the journey. *

    *
  • *
  • *

    * CLOSED - The journey has been published and has started running. It may have also passed its scheduled * end time, or passed its scheduled start time and a refresh frequency hasn't been specified for it. If a * journey's status is CLOSED, you can't add participants to it, and no existing participants can enter the * journey for the first time. However, any existing participants who are currently waiting to start an * activity may resume the journey. *

    *
  • * @see State */ public State state() { return State.fromValue(state); } /** *

    * The current status of the journey. Possible values are: *

    *
      *
    • *

      * DRAFT - The journey is being developed and hasn't been published yet. *

      *
    • *
    • *

      * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the journey may * currently be running or scheduled to start running at a later time. If a journey's status is ACTIVE, you can't * add, change, or remove activities from it. *

      *
    • *
    • *

      * COMPLETED - The journey has been published and has finished running. All participants have entered the journey * and no participants are waiting to complete the journey or any activities in the journey. *

      *
    • *
    • *

      * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, or remove * activities or segment settings from the journey. *

      *
    • *
    • *

      * CLOSED - The journey has been published and has started running. It may have also passed its scheduled end time, * or passed its scheduled start time and a refresh frequency hasn't been specified for it. If a journey's status is * CLOSED, you can't add participants to it, and no existing participants can enter the journey for the first time. * However, any existing participants who are currently waiting to start an activity may resume the journey. *

      *
    • *
    *

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

    * * @return The current status of the journey. Possible values are:

    *
      *
    • *

      * DRAFT - The journey is being developed and hasn't been published yet. *

      *
    • *
    • *

      * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the journey * may currently be running or scheduled to start running at a later time. If a journey's status is ACTIVE, * you can't add, change, or remove activities from it. *

      *
    • *
    • *

      * COMPLETED - The journey has been published and has finished running. All participants have entered the * journey and no participants are waiting to complete the journey or any activities in the journey. *

      *
    • *
    • *

      * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, or * remove activities or segment settings from the journey. *

      *
    • *
    • *

      * CLOSED - The journey has been published and has started running. It may have also passed its scheduled * end time, or passed its scheduled start time and a refresh frequency hasn't been specified for it. If a * journey's status is CLOSED, you can't add participants to it, and no existing participants can enter the * journey for the first time. However, any existing participants who are currently waiting to start an * activity may resume the journey. *

      *
    • * @see State */ public String stateAsString() { return state; } /** *

      * A string-to-string map of key-value pairs that identifies the tags that are associated with the journey. Each tag * consists of a required tag key and an associated tag value. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      * * @return A string-to-string map of key-value pairs that identifies the tags that are associated with the journey. * Each tag consists of a required tag key and an associated tag value. */ public Map 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 int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(activities()); hashCode = 31 * hashCode + Objects.hashCode(applicationId()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(limits()); hashCode = 31 * hashCode + Objects.hashCode(localTime()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(quietTime()); hashCode = 31 * hashCode + Objects.hashCode(refreshFrequency()); hashCode = 31 * hashCode + Objects.hashCode(schedule()); hashCode = 31 * hashCode + Objects.hashCode(startActivity()); hashCode = 31 * hashCode + Objects.hashCode(startCondition()); hashCode = 31 * hashCode + Objects.hashCode(stateAsString()); hashCode = 31 * hashCode + Objects.hashCode(tags()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof JourneyResponse)) { return false; } JourneyResponse other = (JourneyResponse) obj; return Objects.equals(activities(), other.activities()) && Objects.equals(applicationId(), other.applicationId()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(id(), other.id()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()) && Objects.equals(limits(), other.limits()) && Objects.equals(localTime(), other.localTime()) && Objects.equals(name(), other.name()) && Objects.equals(quietTime(), other.quietTime()) && Objects.equals(refreshFrequency(), other.refreshFrequency()) && Objects.equals(schedule(), other.schedule()) && Objects.equals(startActivity(), other.startActivity()) && Objects.equals(startCondition(), other.startCondition()) && Objects.equals(stateAsString(), other.stateAsString()) && 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 String toString() { return ToString.builder("JourneyResponse").add("Activities", activities()).add("ApplicationId", applicationId()) .add("CreationDate", creationDate()).add("Id", id()).add("LastModifiedDate", lastModifiedDate()) .add("Limits", limits()).add("LocalTime", localTime()).add("Name", name()).add("QuietTime", quietTime()) .add("RefreshFrequency", refreshFrequency()).add("Schedule", schedule()).add("StartActivity", startActivity()) .add("StartCondition", startCondition()).add("State", stateAsString()).add("Tags", tags()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Activities": return Optional.ofNullable(clazz.cast(activities())); case "ApplicationId": return Optional.ofNullable(clazz.cast(applicationId())); case "CreationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "Id": return Optional.ofNullable(clazz.cast(id())); case "LastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); case "Limits": return Optional.ofNullable(clazz.cast(limits())); case "LocalTime": return Optional.ofNullable(clazz.cast(localTime())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "QuietTime": return Optional.ofNullable(clazz.cast(quietTime())); case "RefreshFrequency": return Optional.ofNullable(clazz.cast(refreshFrequency())); case "Schedule": return Optional.ofNullable(clazz.cast(schedule())); case "StartActivity": return Optional.ofNullable(clazz.cast(startActivity())); case "StartCondition": return Optional.ofNullable(clazz.cast(startCondition())); case "State": return Optional.ofNullable(clazz.cast(stateAsString())); case "tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((JourneyResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The configuration and other settings for the activities that comprise the journey. *

      * * @param activities * The configuration and other settings for the activities that comprise the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder activities(Map activities); /** *

      * The unique identifier for the application that the journey applies to. *

      * * @param applicationId * The unique identifier for the application that the journey applies to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationId(String applicationId); /** *

      * The date, in ISO 8601 format, when the journey was created. *

      * * @param creationDate * The date, in ISO 8601 format, when the journey was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(String creationDate); /** *

      * The unique identifier for the journey. *

      * * @param id * The unique identifier for the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

      * The date, in ISO 8601 format, when the journey was last modified. *

      * * @param lastModifiedDate * The date, in ISO 8601 format, when the journey was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedDate(String lastModifiedDate); /** *

      * The messaging and entry limits for the journey. *

      * * @param limits * The messaging and entry limits for the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder limits(JourneyLimits limits); /** *

      * The messaging and entry limits for the journey. *

      * This is a convenience that creates an instance of the {@link JourneyLimits.Builder} avoiding the need to * create one manually via {@link JourneyLimits#builder()}. * * When the {@link Consumer} completes, {@link JourneyLimits.Builder#build()} is called immediately and its * result is passed to {@link #limits(JourneyLimits)}. * * @param limits * a consumer that will call methods on {@link JourneyLimits.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #limits(JourneyLimits) */ default Builder limits(Consumer limits) { return limits(JourneyLimits.builder().applyMutation(limits).build()); } /** *

      * Specifies whether the journey's scheduled start and end times use each participant's local time. If this * value is true, the schedule uses each participant's local time. *

      * * @param localTime * Specifies whether the journey's scheduled start and end times use each participant's local time. If * this value is true, the schedule uses each participant's local time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder localTime(Boolean localTime); /** *

      * The name of the journey. *

      * * @param name * The name of the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

      * The quiet time settings for the journey. Quiet time is a specific time range when a journey doesn't send * messages to participants, if all the following conditions are met: *

      *
        *
      • *

        * The EndpointDemographic.Timezone property of the endpoint for the participant is set to a valid value. *

        *
      • *
      • *

        * The current time in the participant's time zone is later than or equal to the time specified by the * QuietTime.Start property for the journey. *

        *
      • *
      • *

        * The current time in the participant's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the journey. *

        *
      • *
      *

      * If any of the preceding conditions isn't met, the participant will receive messages from the journey, even if * quiet time is enabled. *

      * * @param quietTime * The quiet time settings for the journey. Quiet time is a specific time range when a journey doesn't * send messages to participants, if all the following conditions are met:

      *
        *
      • *

        * The EndpointDemographic.Timezone property of the endpoint for the participant is set to a valid value. *

        *
      • *
      • *

        * The current time in the participant's time zone is later than or equal to the time specified by the * QuietTime.Start property for the journey. *

        *
      • *
      • *

        * The current time in the participant's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the journey. *

        *
      • *
      *

      * If any of the preceding conditions isn't met, the participant will receive messages from the journey, * even if quiet time is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder quietTime(QuietTime quietTime); /** *

      * The quiet time settings for the journey. Quiet time is a specific time range when a journey doesn't send * messages to participants, if all the following conditions are met: *

      *
        *
      • *

        * The EndpointDemographic.Timezone property of the endpoint for the participant is set to a valid value. *

        *
      • *
      • *

        * The current time in the participant's time zone is later than or equal to the time specified by the * QuietTime.Start property for the journey. *

        *
      • *
      • *

        * The current time in the participant's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the journey. *

        *
      • *
      *

      * If any of the preceding conditions isn't met, the participant will receive messages from the journey, even if * quiet time is enabled. *

      * This is a convenience that creates an instance of the {@link QuietTime.Builder} avoiding the need to create * one manually via {@link QuietTime#builder()}. * * When the {@link Consumer} completes, {@link QuietTime.Builder#build()} is called immediately and its result * is passed to {@link #quietTime(QuietTime)}. * * @param quietTime * a consumer that will call methods on {@link QuietTime.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #quietTime(QuietTime) */ default Builder quietTime(Consumer quietTime) { return quietTime(QuietTime.builder().applyMutation(quietTime).build()); } /** *

      * The frequency with which Amazon Pinpoint evaluates segment and event data for the journey, as a duration in * ISO 8601 format. *

      * * @param refreshFrequency * The frequency with which Amazon Pinpoint evaluates segment and event data for the journey, as a * duration in ISO 8601 format. * @return Returns a reference to this object so that method calls can be chained together. */ Builder refreshFrequency(String refreshFrequency); /** *

      * The schedule settings for the journey. *

      * * @param schedule * The schedule settings for the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder schedule(JourneySchedule schedule); /** *

      * The schedule settings for the journey. *

      * This is a convenience that creates an instance of the {@link JourneySchedule.Builder} avoiding the need to * create one manually via {@link JourneySchedule#builder()}. * * When the {@link Consumer} completes, {@link JourneySchedule.Builder#build()} is called immediately and its * result is passed to {@link #schedule(JourneySchedule)}. * * @param schedule * a consumer that will call methods on {@link JourneySchedule.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #schedule(JourneySchedule) */ default Builder schedule(Consumer schedule) { return schedule(JourneySchedule.builder().applyMutation(schedule).build()); } /** *

      * The unique identifier for the first activity in the journey. *

      * * @param startActivity * The unique identifier for the first activity in the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startActivity(String startActivity); /** *

      * The segment that defines which users are participants in the journey. *

      * * @param startCondition * The segment that defines which users are participants in the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startCondition(StartCondition startCondition); /** *

      * The segment that defines which users are participants in the journey. *

      * This is a convenience that creates an instance of the {@link StartCondition.Builder} avoiding the need to * create one manually via {@link StartCondition#builder()}. * * When the {@link Consumer} completes, {@link StartCondition.Builder#build()} is called immediately and its * result is passed to {@link #startCondition(StartCondition)}. * * @param startCondition * a consumer that will call methods on {@link StartCondition.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #startCondition(StartCondition) */ default Builder startCondition(Consumer startCondition) { return startCondition(StartCondition.builder().applyMutation(startCondition).build()); } /** *

      * The current status of the journey. Possible values are: *

      *
        *
      • *

        * DRAFT - The journey is being developed and hasn't been published yet. *

        *
      • *
      • *

        * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the journey may * currently be running or scheduled to start running at a later time. If a journey's status is ACTIVE, you * can't add, change, or remove activities from it. *

        *
      • *
      • *

        * COMPLETED - The journey has been published and has finished running. All participants have entered the * journey and no participants are waiting to complete the journey or any activities in the journey. *

        *
      • *
      • *

        * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, or * remove activities or segment settings from the journey. *

        *
      • *
      • *

        * CLOSED - The journey has been published and has started running. It may have also passed its scheduled end * time, or passed its scheduled start time and a refresh frequency hasn't been specified for it. If a journey's * status is CLOSED, you can't add participants to it, and no existing participants can enter the journey for * the first time. However, any existing participants who are currently waiting to start an activity may resume * the journey. *

        *
      • *
      * * @param state * The current status of the journey. Possible values are:

      *
        *
      • *

        * DRAFT - The journey is being developed and hasn't been published yet. *

        *
      • *
      • *

        * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the * journey may currently be running or scheduled to start running at a later time. If a journey's status * is ACTIVE, you can't add, change, or remove activities from it. *

        *
      • *
      • *

        * COMPLETED - The journey has been published and has finished running. All participants have entered the * journey and no participants are waiting to complete the journey or any activities in the journey. *

        *
      • *
      • *

        * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, * or remove activities or segment settings from the journey. *

        *
      • *
      • *

        * CLOSED - The journey has been published and has started running. It may have also passed its scheduled * end time, or passed its scheduled start time and a refresh frequency hasn't been specified for it. If * a journey's status is CLOSED, you can't add participants to it, and no existing participants can enter * the journey for the first time. However, any existing participants who are currently waiting to start * an activity may resume the journey. *

        *
      • * @see State * @return Returns a reference to this object so that method calls can be chained together. * @see State */ Builder state(String state); /** *

        * The current status of the journey. Possible values are: *

        *
          *
        • *

          * DRAFT - The journey is being developed and hasn't been published yet. *

          *
        • *
        • *

          * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the journey may * currently be running or scheduled to start running at a later time. If a journey's status is ACTIVE, you * can't add, change, or remove activities from it. *

          *
        • *
        • *

          * COMPLETED - The journey has been published and has finished running. All participants have entered the * journey and no participants are waiting to complete the journey or any activities in the journey. *

          *
        • *
        • *

          * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, or * remove activities or segment settings from the journey. *

          *
        • *
        • *

          * CLOSED - The journey has been published and has started running. It may have also passed its scheduled end * time, or passed its scheduled start time and a refresh frequency hasn't been specified for it. If a journey's * status is CLOSED, you can't add participants to it, and no existing participants can enter the journey for * the first time. However, any existing participants who are currently waiting to start an activity may resume * the journey. *

          *
        • *
        * * @param state * The current status of the journey. Possible values are:

        *
          *
        • *

          * DRAFT - The journey is being developed and hasn't been published yet. *

          *
        • *
        • *

          * ACTIVE - The journey has been developed and published. Depending on the journey's schedule, the * journey may currently be running or scheduled to start running at a later time. If a journey's status * is ACTIVE, you can't add, change, or remove activities from it. *

          *
        • *
        • *

          * COMPLETED - The journey has been published and has finished running. All participants have entered the * journey and no participants are waiting to complete the journey or any activities in the journey. *

          *
        • *
        • *

          * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, you can't add, change, * or remove activities or segment settings from the journey. *

          *
        • *
        • *

          * CLOSED - The journey has been published and has started running. It may have also passed its scheduled * end time, or passed its scheduled start time and a refresh frequency hasn't been specified for it. If * a journey's status is CLOSED, you can't add participants to it, and no existing participants can enter * the journey for the first time. However, any existing participants who are currently waiting to start * an activity may resume the journey. *

          *
        • * @see State * @return Returns a reference to this object so that method calls can be chained together. * @see State */ Builder state(State state); /** *

          * A string-to-string map of key-value pairs that identifies the tags that are associated with the journey. Each * tag consists of a required tag key and an associated tag value. *

          * * @param tags * A string-to-string map of key-value pairs that identifies the tags that are associated with the * journey. Each tag consists of a required tag key and an associated tag value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); } static final class BuilderImpl implements Builder { private Map activities = DefaultSdkAutoConstructMap.getInstance(); private String applicationId; private String creationDate; private String id; private String lastModifiedDate; private JourneyLimits limits; private Boolean localTime; private String name; private QuietTime quietTime; private String refreshFrequency; private JourneySchedule schedule; private String startActivity; private StartCondition startCondition; private String state; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(JourneyResponse model) { activities(model.activities); applicationId(model.applicationId); creationDate(model.creationDate); id(model.id); lastModifiedDate(model.lastModifiedDate); limits(model.limits); localTime(model.localTime); name(model.name); quietTime(model.quietTime); refreshFrequency(model.refreshFrequency); schedule(model.schedule); startActivity(model.startActivity); startCondition(model.startCondition); state(model.state); tags(model.tags); } public final Map getActivities() { return activities != null ? CollectionUtils.mapValues(activities, Activity::toBuilder) : null; } @Override public final Builder activities(Map activities) { this.activities = MapOfActivityCopier.copy(activities); return this; } public final void setActivities(Map activities) { this.activities = MapOfActivityCopier.copyFromBuilder(activities); } public final String getApplicationId() { return applicationId; } @Override public final Builder applicationId(String applicationId) { this.applicationId = applicationId; return this; } public final void setApplicationId(String applicationId) { this.applicationId = applicationId; } public final String getCreationDate() { return creationDate; } @Override public final Builder creationDate(String creationDate) { this.creationDate = creationDate; return this; } public final void setCreationDate(String creationDate) { this.creationDate = creationDate; } public final String getId() { return id; } @Override public final Builder id(String id) { this.id = id; return this; } public final void setId(String id) { this.id = id; } public final String getLastModifiedDate() { return lastModifiedDate; } @Override public final Builder lastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } public final void setLastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } public final JourneyLimits.Builder getLimits() { return limits != null ? limits.toBuilder() : null; } @Override public final Builder limits(JourneyLimits limits) { this.limits = limits; return this; } public final void setLimits(JourneyLimits.BuilderImpl limits) { this.limits = limits != null ? limits.build() : null; } public final Boolean getLocalTime() { return localTime; } @Override public final Builder localTime(Boolean localTime) { this.localTime = localTime; return this; } public final void setLocalTime(Boolean localTime) { this.localTime = localTime; } public final String getName() { return name; } @Override public final Builder name(String name) { this.name = name; return this; } public final void setName(String name) { this.name = name; } public final QuietTime.Builder getQuietTime() { return quietTime != null ? quietTime.toBuilder() : null; } @Override public final Builder quietTime(QuietTime quietTime) { this.quietTime = quietTime; return this; } public final void setQuietTime(QuietTime.BuilderImpl quietTime) { this.quietTime = quietTime != null ? quietTime.build() : null; } public final String getRefreshFrequency() { return refreshFrequency; } @Override public final Builder refreshFrequency(String refreshFrequency) { this.refreshFrequency = refreshFrequency; return this; } public final void setRefreshFrequency(String refreshFrequency) { this.refreshFrequency = refreshFrequency; } public final JourneySchedule.Builder getSchedule() { return schedule != null ? schedule.toBuilder() : null; } @Override public final Builder schedule(JourneySchedule schedule) { this.schedule = schedule; return this; } public final void setSchedule(JourneySchedule.BuilderImpl schedule) { this.schedule = schedule != null ? schedule.build() : null; } public final String getStartActivity() { return startActivity; } @Override public final Builder startActivity(String startActivity) { this.startActivity = startActivity; return this; } public final void setStartActivity(String startActivity) { this.startActivity = startActivity; } public final StartCondition.Builder getStartCondition() { return startCondition != null ? startCondition.toBuilder() : null; } @Override public final Builder startCondition(StartCondition startCondition) { this.startCondition = startCondition; return this; } public final void setStartCondition(StartCondition.BuilderImpl startCondition) { this.startCondition = startCondition != null ? startCondition.build() : null; } public final String getStateAsString() { return state; } @Override public final Builder state(String state) { this.state = state; return this; } @Override public final Builder state(State state) { this.state(state == null ? null : state.toString()); return this; } public final void setState(String state) { this.state = state; } public final Map getTags() { return tags; } @Override public final Builder tags(Map tags) { this.tags = MapOf__stringCopier.copy(tags); return this; } public final void setTags(Map tags) { this.tags = MapOf__stringCopier.copy(tags); } @Override public JourneyResponse build() { return new JourneyResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy