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.27.19
Show newest version
/*
 * 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.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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) .memberName("Activities") .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) .memberName("ApplicationId").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) .memberName("CreationDate").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).memberName("Id") .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) .memberName("LastModifiedDate").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) .memberName("Limits").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) .memberName("LocalTime").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).memberName("Name") .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) .memberName("QuietTime").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) .memberName("RefreshFrequency").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) .memberName("Schedule").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) .memberName("StartActivity").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).memberName("StartCondition") .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).memberName("State") .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) .memberName("tags") .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 SdkField WAIT_FOR_QUIET_TIME_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("WaitForQuietTime").getter(getter(JourneyResponse::waitForQuietTime)) .setter(setter(Builder::waitForQuietTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WaitForQuietTime").build()).build(); private static final SdkField REFRESH_ON_SEGMENT_UPDATE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("RefreshOnSegmentUpdate").getter(getter(JourneyResponse::refreshOnSegmentUpdate)) .setter(setter(Builder::refreshOnSegmentUpdate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RefreshOnSegmentUpdate").build()) .build(); private static final SdkField JOURNEY_CHANNEL_SETTINGS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("JourneyChannelSettings") .getter(getter(JourneyResponse::journeyChannelSettings)).setter(setter(Builder::journeyChannelSettings)) .constructor(JourneyChannelSettings::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JourneyChannelSettings").build()) .build(); private static final SdkField SENDING_SCHEDULE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("SendingSchedule").getter(getter(JourneyResponse::sendingSchedule)) .setter(setter(Builder::sendingSchedule)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SendingSchedule").build()).build(); private static final SdkField OPEN_HOURS_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("OpenHours").getter(getter(JourneyResponse::openHours)).setter(setter(Builder::openHours)) .constructor(OpenHours::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OpenHours").build()).build(); private static final SdkField CLOSED_DAYS_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("ClosedDays").getter(getter(JourneyResponse::closedDays)).setter(setter(Builder::closedDays)) .constructor(ClosedDays::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClosedDays").build()).build(); private static final SdkField> TIMEZONE_ESTIMATION_METHODS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("TimezoneEstimationMethods") .getter(getter(JourneyResponse::timezoneEstimationMethodsAsStrings)) .setter(setter(Builder::timezoneEstimationMethodsWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimezoneEstimationMethods").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").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, WAIT_FOR_QUIET_TIME_FIELD, REFRESH_ON_SEGMENT_UPDATE_FIELD, JOURNEY_CHANNEL_SETTINGS_FIELD, SENDING_SCHEDULE_FIELD, OPEN_HOURS_FIELD, CLOSED_DAYS_FIELD, TIMEZONE_ESTIMATION_METHODS_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 final Boolean waitForQuietTime; private final Boolean refreshOnSegmentUpdate; private final JourneyChannelSettings journeyChannelSettings; private final Boolean sendingSchedule; private final OpenHours openHours; private final ClosedDays closedDays; private final List timezoneEstimationMethods; 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; this.waitForQuietTime = builder.waitForQuietTime; this.refreshOnSegmentUpdate = builder.refreshOnSegmentUpdate; this.journeyChannelSettings = builder.journeyChannelSettings; this.sendingSchedule = builder.sendingSchedule; this.openHours = builder.openHours; this.closedDays = builder.closedDays; this.timezoneEstimationMethods = builder.timezoneEstimationMethods; } /** * For responses, this returns true if the service returned a value for the Activities property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasActivities() { return activities != null && !(activities instanceof SdkAutoConstructMap); } /** *

* A map that contains a set of Activity objects, one object for each activity in the journey. For each Activity * object, the key is the unique identifier (string) for an activity and the value is the settings for the activity. *

*

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

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasActivities} method. *

* * @return A map that contains a set of Activity objects, one object for each activity in the journey. For each * Activity object, the key is the unique identifier (string) for an activity and the value is the settings * for the activity. */ public final 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 final 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 final String creationDate() { return creationDate; } /** *

* The unique identifier for the journey. *

* * @return The unique identifier for the journey. */ public final 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 final String lastModifiedDate() { return lastModifiedDate; } /** *

* The messaging and entry limits for the journey. *

* * @return The messaging and entry limits for the journey. */ public final 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 final Boolean localTime() { return localTime; } /** *

* The name of the journey. *

* * @return The name of the journey. */ public final 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 final 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 final String refreshFrequency() { return refreshFrequency; } /** *

* The schedule settings for the journey. *

* * @return The schedule settings for the journey. */ public final 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 final 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 final 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 continue 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 continue the journey. *

    *
  • * @see State */ public final 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 continue 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 continue the journey. *

      *
    • * @see State */ public final String stateAsString() { return state; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

      * This object is not used or supported. *

      *

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

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

      * * @return This object is not used or supported. */ public final Map tags() { return tags; } /** *

      * Indicates whether endpoints in quiet hours should enter a wait activity until quiet hours have elapsed. *

      * * @return Indicates whether endpoints in quiet hours should enter a wait activity until quiet hours have elapsed. */ public final Boolean waitForQuietTime() { return waitForQuietTime; } /** *

      * Indicates whether the journey participants should be refreshed when a segment is updated. *

      * * @return Indicates whether the journey participants should be refreshed when a segment is updated. */ public final Boolean refreshOnSegmentUpdate() { return refreshOnSegmentUpdate; } /** *

      * The channel-specific configurations for the journey. *

      * * @return The channel-specific configurations for the journey. */ public final JourneyChannelSettings journeyChannelSettings() { return journeyChannelSettings; } /** *

      * Indicates if journey has Advance Quiet Time enabled. This flag should be set to true in order to allow using * OpenHours and ClosedDays. *

      * * @return Indicates if journey has Advance Quiet Time enabled. This flag should be set to true in order to allow * using OpenHours and ClosedDays. */ public final Boolean sendingSchedule() { return sendingSchedule; } /** *

      * The time when a journey can send messages. QuietTime should be configured first and SendingSchedule should be set * to true. *

      * * @return The time when a journey can send messages. QuietTime should be configured first and SendingSchedule * should be set to true. */ public final OpenHours openHours() { return openHours; } /** *

      * The time when a journey will not send messages. QuietTime should be configured first and SendingSchedule should * be set to true. *

      * * @return The time when a journey will not send messages. QuietTime should be configured first and SendingSchedule * should be set to true. */ public final ClosedDays closedDays() { return closedDays; } /** *

      * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone attribute. *

      *
        *
      • *

        * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

        *
      • *
      • *

        * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and Endpoint.Location.Country. *

        * *

        * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, Canada, * France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

        *
      • *
      *

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

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTimezoneEstimationMethods} method. *

      * * @return An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone * attribute.

      *
        *
      • *

        * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

        *
      • *
      • *

        * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

        * *

        * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, * Canada, France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

        *
      • */ public final List<__TimezoneEstimationMethodsElement> timezoneEstimationMethods() { return ListOf__TimezoneEstimationMethodsElementCopier.copyStringToEnum(timezoneEstimationMethods); } /** * For responses, this returns true if the service returned a value for the TimezoneEstimationMethods property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasTimezoneEstimationMethods() { return timezoneEstimationMethods != null && !(timezoneEstimationMethods instanceof SdkAutoConstructList); } /** *

        * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone attribute. *

        *
          *
        • *

          * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

          *
        • *
        • *

          * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and Endpoint.Location.Country. *

          * *

          * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, Canada, * France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

          *
        • *
        *

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

        *

        * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTimezoneEstimationMethods} method. *

        * * @return An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone * attribute.

        *
          *
        • *

          * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

          *
        • *
        • *

          * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

          * *

          * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, * Canada, France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

          *
        • */ public final List timezoneEstimationMethodsAsStrings() { return timezoneEstimationMethods; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(hasActivities() ? activities() : null); 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(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(waitForQuietTime()); hashCode = 31 * hashCode + Objects.hashCode(refreshOnSegmentUpdate()); hashCode = 31 * hashCode + Objects.hashCode(journeyChannelSettings()); hashCode = 31 * hashCode + Objects.hashCode(sendingSchedule()); hashCode = 31 * hashCode + Objects.hashCode(openHours()); hashCode = 31 * hashCode + Objects.hashCode(closedDays()); hashCode = 31 * hashCode + Objects.hashCode(hasTimezoneEstimationMethods() ? timezoneEstimationMethodsAsStrings() : null); 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 JourneyResponse)) { return false; } JourneyResponse other = (JourneyResponse) obj; return hasActivities() == other.hasActivities() && 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()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(waitForQuietTime(), other.waitForQuietTime()) && Objects.equals(refreshOnSegmentUpdate(), other.refreshOnSegmentUpdate()) && Objects.equals(journeyChannelSettings(), other.journeyChannelSettings()) && Objects.equals(sendingSchedule(), other.sendingSchedule()) && Objects.equals(openHours(), other.openHours()) && Objects.equals(closedDays(), other.closedDays()) && hasTimezoneEstimationMethods() == other.hasTimezoneEstimationMethods() && Objects.equals(timezoneEstimationMethodsAsStrings(), other.timezoneEstimationMethodsAsStrings()); } /** * 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("JourneyResponse").add("Activities", hasActivities() ? activities() : null) .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", hasTags() ? tags() : null).add("WaitForQuietTime", waitForQuietTime()) .add("RefreshOnSegmentUpdate", refreshOnSegmentUpdate()).add("JourneyChannelSettings", journeyChannelSettings()) .add("SendingSchedule", sendingSchedule()).add("OpenHours", openHours()).add("ClosedDays", closedDays()) .add("TimezoneEstimationMethods", hasTimezoneEstimationMethods() ? timezoneEstimationMethodsAsStrings() : null) .build(); } public final 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())); case "WaitForQuietTime": return Optional.ofNullable(clazz.cast(waitForQuietTime())); case "RefreshOnSegmentUpdate": return Optional.ofNullable(clazz.cast(refreshOnSegmentUpdate())); case "JourneyChannelSettings": return Optional.ofNullable(clazz.cast(journeyChannelSettings())); case "SendingSchedule": return Optional.ofNullable(clazz.cast(sendingSchedule())); case "OpenHours": return Optional.ofNullable(clazz.cast(openHours())); case "ClosedDays": return Optional.ofNullable(clazz.cast(closedDays())); case "TimezoneEstimationMethods": return Optional.ofNullable(clazz.cast(timezoneEstimationMethodsAsStrings())); default: return Optional.empty(); } } @Override public final 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 { /** *

          * A map that contains a set of Activity objects, one object for each activity in the journey. For each Activity * object, the key is the unique identifier (string) for an activity and the value is the settings for the * activity. *

          * * @param activities * A map that contains a set of Activity objects, one object for each activity in the journey. For each * Activity object, the key is the unique identifier (string) for an activity and the value is the * settings for the activity. * @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 method 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 method 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 method 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 method 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 * continue 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 continue 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 * continue 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 continue 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); /** *

              * This object is not used or supported. *

              * * @param tags * This object is not used or supported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

              * Indicates whether endpoints in quiet hours should enter a wait activity until quiet hours have elapsed. *

              * * @param waitForQuietTime * Indicates whether endpoints in quiet hours should enter a wait activity until quiet hours have * elapsed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder waitForQuietTime(Boolean waitForQuietTime); /** *

              * Indicates whether the journey participants should be refreshed when a segment is updated. *

              * * @param refreshOnSegmentUpdate * Indicates whether the journey participants should be refreshed when a segment is updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder refreshOnSegmentUpdate(Boolean refreshOnSegmentUpdate); /** *

              * The channel-specific configurations for the journey. *

              * * @param journeyChannelSettings * The channel-specific configurations for the journey. * @return Returns a reference to this object so that method calls can be chained together. */ Builder journeyChannelSettings(JourneyChannelSettings journeyChannelSettings); /** *

              * The channel-specific configurations for the journey. *

              * This is a convenience method that creates an instance of the {@link JourneyChannelSettings.Builder} avoiding * the need to create one manually via {@link JourneyChannelSettings#builder()}. * *

              * When the {@link Consumer} completes, {@link JourneyChannelSettings.Builder#build()} is called immediately and * its result is passed to {@link #journeyChannelSettings(JourneyChannelSettings)}. * * @param journeyChannelSettings * a consumer that will call methods on {@link JourneyChannelSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #journeyChannelSettings(JourneyChannelSettings) */ default Builder journeyChannelSettings(Consumer journeyChannelSettings) { return journeyChannelSettings(JourneyChannelSettings.builder().applyMutation(journeyChannelSettings).build()); } /** *

              * Indicates if journey has Advance Quiet Time enabled. This flag should be set to true in order to allow using * OpenHours and ClosedDays. *

              * * @param sendingSchedule * Indicates if journey has Advance Quiet Time enabled. This flag should be set to true in order to allow * using OpenHours and ClosedDays. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sendingSchedule(Boolean sendingSchedule); /** *

              * The time when a journey can send messages. QuietTime should be configured first and SendingSchedule should be * set to true. *

              * * @param openHours * The time when a journey can send messages. QuietTime should be configured first and SendingSchedule * should be set to true. * @return Returns a reference to this object so that method calls can be chained together. */ Builder openHours(OpenHours openHours); /** *

              * The time when a journey can send messages. QuietTime should be configured first and SendingSchedule should be * set to true. *

              * This is a convenience method that creates an instance of the {@link OpenHours.Builder} avoiding the need to * create one manually via {@link OpenHours#builder()}. * *

              * When the {@link Consumer} completes, {@link OpenHours.Builder#build()} is called immediately and its result * is passed to {@link #openHours(OpenHours)}. * * @param openHours * a consumer that will call methods on {@link OpenHours.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #openHours(OpenHours) */ default Builder openHours(Consumer openHours) { return openHours(OpenHours.builder().applyMutation(openHours).build()); } /** *

              * The time when a journey will not send messages. QuietTime should be configured first and SendingSchedule * should be set to true. *

              * * @param closedDays * The time when a journey will not send messages. QuietTime should be configured first and * SendingSchedule should be set to true. * @return Returns a reference to this object so that method calls can be chained together. */ Builder closedDays(ClosedDays closedDays); /** *

              * The time when a journey will not send messages. QuietTime should be configured first and SendingSchedule * should be set to true. *

              * This is a convenience method that creates an instance of the {@link ClosedDays.Builder} avoiding the need to * create one manually via {@link ClosedDays#builder()}. * *

              * When the {@link Consumer} completes, {@link ClosedDays.Builder#build()} is called immediately and its result * is passed to {@link #closedDays(ClosedDays)}. * * @param closedDays * a consumer that will call methods on {@link ClosedDays.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #closedDays(ClosedDays) */ default Builder closedDays(Consumer closedDays) { return closedDays(ClosedDays.builder().applyMutation(closedDays).build()); } /** *

              * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone attribute. *

              *
                *
              • *

                * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                *
              • *
              • *

                * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                * *

                * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, Canada, * France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

                *
              • *
              * * @param timezoneEstimationMethods * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone * attribute.

              *
                *
              • *

                * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                *
              • *
              • *

                * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                * *

                * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, * Canada, France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

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

                * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone attribute. *

                *
                  *
                • *

                  * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                  *
                • *
                • *

                  * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                  * *

                  * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, Canada, * France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

                  *
                • *
                * * @param timezoneEstimationMethods * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone * attribute.

                *
                  *
                • *

                  * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                  *
                • *
                • *

                  * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                  * *

                  * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, * Canada, France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

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

                  * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone attribute. *

                  *
                    *
                  • *

                    * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                    *
                  • *
                  • *

                    * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                    * *

                    * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, Canada, * France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

                    *
                  • *
                  * * @param timezoneEstimationMethods * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone * attribute.

                  *
                    *
                  • *

                    * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                    *
                  • *
                  • *

                    * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                    * *

                    * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, * Canada, France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

                    *
                  • * @return Returns a reference to this object so that method calls can be chained together. */ Builder timezoneEstimationMethods(Collection<__TimezoneEstimationMethodsElement> timezoneEstimationMethods); /** *

                    * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone attribute. *

                    *
                      *
                    • *

                      * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                      *
                    • *
                    • *

                      * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                      * *

                      * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, Canada, * France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

                      *
                    • *
                    * * @param timezoneEstimationMethods * An array of time zone estimation methods, if any, to use for determining an Endpoints time zone if the Endpoint does not have a value for the Demographic.Timezone * attribute.

                    *
                      *
                    • *

                      * PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and Endpoint.Location.Country. *

                      *
                    • *
                    • *

                      * POSTAL_CODE - A time zone is determined based on the Endpoint.Location.PostalCode and * Endpoint.Location.Country. *

                      * *

                      * POSTAL_CODE detection is only supported in the United States, United Kingdom, Australia, New Zealand, * Canada, France, Italy, Spain, Germany and in regions where Amazon Pinpoint is available. *

                      *
                    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder timezoneEstimationMethods(__TimezoneEstimationMethodsElement... timezoneEstimationMethods); } 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 Boolean waitForQuietTime; private Boolean refreshOnSegmentUpdate; private JourneyChannelSettings journeyChannelSettings; private Boolean sendingSchedule; private OpenHours openHours; private ClosedDays closedDays; private List timezoneEstimationMethods = DefaultSdkAutoConstructList.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); waitForQuietTime(model.waitForQuietTime); refreshOnSegmentUpdate(model.refreshOnSegmentUpdate); journeyChannelSettings(model.journeyChannelSettings); sendingSchedule(model.sendingSchedule); openHours(model.openHours); closedDays(model.closedDays); timezoneEstimationMethodsWithStrings(model.timezoneEstimationMethods); } public final Map getActivities() { Map result = MapOfActivityCopier.copyToBuilder(this.activities); if (result instanceof SdkAutoConstructMap) { return null; } return result; } public final void setActivities(Map activities) { this.activities = MapOfActivityCopier.copyFromBuilder(activities); } @Override public final Builder activities(Map activities) { this.activities = MapOfActivityCopier.copy(activities); return this; } public final String getApplicationId() { return applicationId; } public final void setApplicationId(String applicationId) { this.applicationId = applicationId; } @Override public final Builder applicationId(String applicationId) { this.applicationId = applicationId; return this; } public final String getCreationDate() { return creationDate; } public final void setCreationDate(String creationDate) { this.creationDate = creationDate; } @Override public final Builder creationDate(String creationDate) { this.creationDate = creationDate; return this; } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getLastModifiedDate() { return lastModifiedDate; } public final void setLastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; } @Override public final Builder lastModifiedDate(String lastModifiedDate) { this.lastModifiedDate = lastModifiedDate; return this; } public final JourneyLimits.Builder getLimits() { return limits != null ? limits.toBuilder() : null; } public final void setLimits(JourneyLimits.BuilderImpl limits) { this.limits = limits != null ? limits.build() : null; } @Override public final Builder limits(JourneyLimits limits) { this.limits = limits; return this; } public final Boolean getLocalTime() { return localTime; } public final void setLocalTime(Boolean localTime) { this.localTime = localTime; } @Override public final Builder localTime(Boolean localTime) { this.localTime = localTime; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final QuietTime.Builder getQuietTime() { return quietTime != null ? quietTime.toBuilder() : null; } public final void setQuietTime(QuietTime.BuilderImpl quietTime) { this.quietTime = quietTime != null ? quietTime.build() : null; } @Override public final Builder quietTime(QuietTime quietTime) { this.quietTime = quietTime; return this; } public final String getRefreshFrequency() { return refreshFrequency; } public final void setRefreshFrequency(String refreshFrequency) { this.refreshFrequency = refreshFrequency; } @Override public final Builder refreshFrequency(String refreshFrequency) { this.refreshFrequency = refreshFrequency; return this; } public final JourneySchedule.Builder getSchedule() { return schedule != null ? schedule.toBuilder() : null; } public final void setSchedule(JourneySchedule.BuilderImpl schedule) { this.schedule = schedule != null ? schedule.build() : null; } @Override public final Builder schedule(JourneySchedule schedule) { this.schedule = schedule; return this; } public final String getStartActivity() { return startActivity; } public final void setStartActivity(String startActivity) { this.startActivity = startActivity; } @Override public final Builder startActivity(String startActivity) { this.startActivity = startActivity; return this; } public final StartCondition.Builder getStartCondition() { return startCondition != null ? startCondition.toBuilder() : null; } public final void setStartCondition(StartCondition.BuilderImpl startCondition) { this.startCondition = startCondition != null ? startCondition.build() : null; } @Override public final Builder startCondition(StartCondition startCondition) { this.startCondition = startCondition; return this; } public final String getState() { return state; } public final void setState(String state) { this.state = 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 Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = MapOf__stringCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = MapOf__stringCopier.copy(tags); return this; } public final Boolean getWaitForQuietTime() { return waitForQuietTime; } public final void setWaitForQuietTime(Boolean waitForQuietTime) { this.waitForQuietTime = waitForQuietTime; } @Override public final Builder waitForQuietTime(Boolean waitForQuietTime) { this.waitForQuietTime = waitForQuietTime; return this; } public final Boolean getRefreshOnSegmentUpdate() { return refreshOnSegmentUpdate; } public final void setRefreshOnSegmentUpdate(Boolean refreshOnSegmentUpdate) { this.refreshOnSegmentUpdate = refreshOnSegmentUpdate; } @Override public final Builder refreshOnSegmentUpdate(Boolean refreshOnSegmentUpdate) { this.refreshOnSegmentUpdate = refreshOnSegmentUpdate; return this; } public final JourneyChannelSettings.Builder getJourneyChannelSettings() { return journeyChannelSettings != null ? journeyChannelSettings.toBuilder() : null; } public final void setJourneyChannelSettings(JourneyChannelSettings.BuilderImpl journeyChannelSettings) { this.journeyChannelSettings = journeyChannelSettings != null ? journeyChannelSettings.build() : null; } @Override public final Builder journeyChannelSettings(JourneyChannelSettings journeyChannelSettings) { this.journeyChannelSettings = journeyChannelSettings; return this; } public final Boolean getSendingSchedule() { return sendingSchedule; } public final void setSendingSchedule(Boolean sendingSchedule) { this.sendingSchedule = sendingSchedule; } @Override public final Builder sendingSchedule(Boolean sendingSchedule) { this.sendingSchedule = sendingSchedule; return this; } public final OpenHours.Builder getOpenHours() { return openHours != null ? openHours.toBuilder() : null; } public final void setOpenHours(OpenHours.BuilderImpl openHours) { this.openHours = openHours != null ? openHours.build() : null; } @Override public final Builder openHours(OpenHours openHours) { this.openHours = openHours; return this; } public final ClosedDays.Builder getClosedDays() { return closedDays != null ? closedDays.toBuilder() : null; } public final void setClosedDays(ClosedDays.BuilderImpl closedDays) { this.closedDays = closedDays != null ? closedDays.build() : null; } @Override public final Builder closedDays(ClosedDays closedDays) { this.closedDays = closedDays; return this; } public final Collection getTimezoneEstimationMethods() { if (timezoneEstimationMethods instanceof SdkAutoConstructList) { return null; } return timezoneEstimationMethods; } public final void setTimezoneEstimationMethods(Collection timezoneEstimationMethods) { this.timezoneEstimationMethods = ListOf__TimezoneEstimationMethodsElementCopier.copy(timezoneEstimationMethods); } @Override public final Builder timezoneEstimationMethodsWithStrings(Collection timezoneEstimationMethods) { this.timezoneEstimationMethods = ListOf__TimezoneEstimationMethodsElementCopier.copy(timezoneEstimationMethods); return this; } @Override @SafeVarargs public final Builder timezoneEstimationMethodsWithStrings(String... timezoneEstimationMethods) { timezoneEstimationMethodsWithStrings(Arrays.asList(timezoneEstimationMethods)); return this; } @Override public final Builder timezoneEstimationMethods(Collection<__TimezoneEstimationMethodsElement> timezoneEstimationMethods) { this.timezoneEstimationMethods = ListOf__TimezoneEstimationMethodsElementCopier .copyEnumToString(timezoneEstimationMethods); return this; } @Override @SafeVarargs public final Builder timezoneEstimationMethods(__TimezoneEstimationMethodsElement... timezoneEstimationMethods) { timezoneEstimationMethods(Arrays.asList(timezoneEstimationMethods)); return this; } @Override public JourneyResponse build() { return new JourneyResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy