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

software.amazon.awssdk.services.pinpoint.model.ApplicationSettingsResource 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

The 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.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Provides information about an application, including the default settings for an application. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ApplicationSettingsResource implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ApplicationId").getter(getter(ApplicationSettingsResource::applicationId)) .setter(setter(Builder::applicationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationId").build()).build(); private static final SdkField CAMPAIGN_HOOK_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("CampaignHook").getter(getter(ApplicationSettingsResource::campaignHook)) .setter(setter(Builder::campaignHook)).constructor(CampaignHook::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CampaignHook").build()).build(); private static final SdkField LAST_MODIFIED_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LastModifiedDate").getter(getter(ApplicationSettingsResource::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(ApplicationSettingsResource::limits)).setter(setter(Builder::limits)) .constructor(CampaignLimits::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Limits").build()).build(); private static final SdkField QUIET_TIME_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("QuietTime").getter(getter(ApplicationSettingsResource::quietTime)).setter(setter(Builder::quietTime)) .constructor(QuietTime::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("QuietTime").build()).build(); private static final SdkField JOURNEY_LIMITS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("JourneyLimits") .getter(getter(ApplicationSettingsResource::journeyLimits)).setter(setter(Builder::journeyLimits)) .constructor(ApplicationSettingsJourneyLimits::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JourneyLimits").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ID_FIELD, CAMPAIGN_HOOK_FIELD, LAST_MODIFIED_DATE_FIELD, LIMITS_FIELD, QUIET_TIME_FIELD, JOURNEY_LIMITS_FIELD)); private static final long serialVersionUID = 1L; private final String applicationId; private final CampaignHook campaignHook; private final String lastModifiedDate; private final CampaignLimits limits; private final QuietTime quietTime; private final ApplicationSettingsJourneyLimits journeyLimits; private ApplicationSettingsResource(BuilderImpl builder) { this.applicationId = builder.applicationId; this.campaignHook = builder.campaignHook; this.lastModifiedDate = builder.lastModifiedDate; this.limits = builder.limits; this.quietTime = builder.quietTime; this.journeyLimits = builder.journeyLimits; } /** *

* The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon * Pinpoint console. *

* * @return The unique identifier for the application. This identifier is displayed as the Project ID on the * Amazon Pinpoint console. */ public final String applicationId() { return applicationId; } /** *

* The settings for the AWS Lambda function to invoke by default as a code hook for campaigns in the application. * You can use this hook to customize segments that are used by campaigns in the application. *

* * @return The settings for the AWS Lambda function to invoke by default as a code hook for campaigns in the * application. You can use this hook to customize segments that are used by campaigns in the application. */ public final CampaignHook campaignHook() { return campaignHook; } /** *

* The date and time, in ISO 8601 format, when the application's settings were last modified. *

* * @return The date and time, in ISO 8601 format, when the application's settings were last modified. */ public final String lastModifiedDate() { return lastModifiedDate; } /** *

* The default sending limits for campaigns in the application. *

* * @return The default sending limits for campaigns in the application. */ public final CampaignLimits limits() { return limits; } /** *

* The default quiet time for campaigns in the application. Quiet time is a specific time range when messages aren't * sent to endpoints, if all the following conditions are met: *

*
    *
  • *

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

    *
  • *
  • *

    * The current time in the endpoint's time zone is later than or equal to the time specified by the QuietTime.Start * property for the application (or a campaign or journey that has custom quiet time settings). *

    *
  • *
  • *

    * The current time in the endpoint's time zone is earlier than or equal to the time specified by the QuietTime.End * property for the application (or a campaign or journey that has custom quiet time settings). *

    *
  • *
*

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

* * @return The default quiet time for campaigns in the application. Quiet time is a specific time range when * messages aren't sent to endpoints, if all the following conditions are met:

*
    *
  • *

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

    *
  • *
  • *

    * The current time in the endpoint's time zone is later than or equal to the time specified by the * QuietTime.Start property for the application (or a campaign or journey that has custom quiet time * settings). *

    *
  • *
  • *

    * The current time in the endpoint's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the application (or a campaign or journey that has custom quiet time * settings). *

    *
  • *
*

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

* The default sending limits for journeys in the application. These limits apply to each journey for the * application but can be overridden, on a per journey basis, with the JourneyLimits resource. *

* * @return The default sending limits for journeys in the application. These limits apply to each journey for the * application but can be overridden, on a per journey basis, with the JourneyLimits resource. */ public final ApplicationSettingsJourneyLimits journeyLimits() { return journeyLimits; } @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(applicationId()); hashCode = 31 * hashCode + Objects.hashCode(campaignHook()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedDate()); hashCode = 31 * hashCode + Objects.hashCode(limits()); hashCode = 31 * hashCode + Objects.hashCode(quietTime()); hashCode = 31 * hashCode + Objects.hashCode(journeyLimits()); 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 ApplicationSettingsResource)) { return false; } ApplicationSettingsResource other = (ApplicationSettingsResource) obj; return Objects.equals(applicationId(), other.applicationId()) && Objects.equals(campaignHook(), other.campaignHook()) && Objects.equals(lastModifiedDate(), other.lastModifiedDate()) && Objects.equals(limits(), other.limits()) && Objects.equals(quietTime(), other.quietTime()) && Objects.equals(journeyLimits(), other.journeyLimits()); } /** * 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("ApplicationSettingsResource").add("ApplicationId", applicationId()) .add("CampaignHook", campaignHook()).add("LastModifiedDate", lastModifiedDate()).add("Limits", limits()) .add("QuietTime", quietTime()).add("JourneyLimits", journeyLimits()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ApplicationId": return Optional.ofNullable(clazz.cast(applicationId())); case "CampaignHook": return Optional.ofNullable(clazz.cast(campaignHook())); case "LastModifiedDate": return Optional.ofNullable(clazz.cast(lastModifiedDate())); case "Limits": return Optional.ofNullable(clazz.cast(limits())); case "QuietTime": return Optional.ofNullable(clazz.cast(quietTime())); case "JourneyLimits": return Optional.ofNullable(clazz.cast(journeyLimits())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ApplicationSettingsResource) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The unique identifier for the application. This identifier is displayed as the Project ID on the * Amazon Pinpoint console. *

* * @param applicationId * The unique identifier for the application. This identifier is displayed as the Project ID on * the Amazon Pinpoint console. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationId(String applicationId); /** *

* The settings for the AWS Lambda function to invoke by default as a code hook for campaigns in the * application. You can use this hook to customize segments that are used by campaigns in the application. *

* * @param campaignHook * The settings for the AWS Lambda function to invoke by default as a code hook for campaigns in the * application. You can use this hook to customize segments that are used by campaigns in the * application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder campaignHook(CampaignHook campaignHook); /** *

* The settings for the AWS Lambda function to invoke by default as a code hook for campaigns in the * application. You can use this hook to customize segments that are used by campaigns in the application. *

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

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

* The date and time, in ISO 8601 format, when the application's settings were last modified. *

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

* The default sending limits for campaigns in the application. *

* * @param limits * The default sending limits for campaigns in the application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder limits(CampaignLimits limits); /** *

* The default sending limits for campaigns in the application. *

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

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

* The default quiet time for campaigns in the application. Quiet time is a specific time range when messages * aren't sent to endpoints, if all the following conditions are met: *

*
    *
  • *

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

    *
  • *
  • *

    * The current time in the endpoint's time zone is later than or equal to the time specified by the * QuietTime.Start property for the application (or a campaign or journey that has custom quiet time settings). *

    *
  • *
  • *

    * The current time in the endpoint's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the application (or a campaign or journey that has custom quiet time settings). *

    *
  • *
*

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

* * @param quietTime * The default quiet time for campaigns in the application. Quiet time is a specific time range when * messages aren't sent to endpoints, if all the following conditions are met:

*
    *
  • *

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

    *
  • *
  • *

    * The current time in the endpoint's time zone is later than or equal to the time specified by the * QuietTime.Start property for the application (or a campaign or journey that has custom quiet time * settings). *

    *
  • *
  • *

    * The current time in the endpoint's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the application (or a campaign or journey that has custom quiet time * settings). *

    *
  • *
*

* If any of the preceding conditions isn't met, the endpoint will receive messages from a campaign or * 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 default quiet time for campaigns in the application. Quiet time is a specific time range when messages * aren't sent to endpoints, if all the following conditions are met: *

*
    *
  • *

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

    *
  • *
  • *

    * The current time in the endpoint's time zone is later than or equal to the time specified by the * QuietTime.Start property for the application (or a campaign or journey that has custom quiet time settings). *

    *
  • *
  • *

    * The current time in the endpoint's time zone is earlier than or equal to the time specified by the * QuietTime.End property for the application (or a campaign or journey that has custom quiet time settings). *

    *
  • *
*

* If any of the preceding conditions isn't met, the endpoint will receive messages from a campaign or 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 default sending limits for journeys in the application. These limits apply to each journey for the * application but can be overridden, on a per journey basis, with the JourneyLimits resource. *

* * @param journeyLimits * The default sending limits for journeys in the application. These limits apply to each journey for the * application but can be overridden, on a per journey basis, with the JourneyLimits resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder journeyLimits(ApplicationSettingsJourneyLimits journeyLimits); /** *

* The default sending limits for journeys in the application. These limits apply to each journey for the * application but can be overridden, on a per journey basis, with the JourneyLimits resource. *

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

* When the {@link Consumer} completes, {@link ApplicationSettingsJourneyLimits.Builder#build()} is called * immediately and its result is passed to {@link #journeyLimits(ApplicationSettingsJourneyLimits)}. * * @param journeyLimits * a consumer that will call methods on {@link ApplicationSettingsJourneyLimits.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #journeyLimits(ApplicationSettingsJourneyLimits) */ default Builder journeyLimits(Consumer journeyLimits) { return journeyLimits(ApplicationSettingsJourneyLimits.builder().applyMutation(journeyLimits).build()); } } static final class BuilderImpl implements Builder { private String applicationId; private CampaignHook campaignHook; private String lastModifiedDate; private CampaignLimits limits; private QuietTime quietTime; private ApplicationSettingsJourneyLimits journeyLimits; private BuilderImpl() { } private BuilderImpl(ApplicationSettingsResource model) { applicationId(model.applicationId); campaignHook(model.campaignHook); lastModifiedDate(model.lastModifiedDate); limits(model.limits); quietTime(model.quietTime); journeyLimits(model.journeyLimits); } 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 CampaignHook.Builder getCampaignHook() { return campaignHook != null ? campaignHook.toBuilder() : null; } public final void setCampaignHook(CampaignHook.BuilderImpl campaignHook) { this.campaignHook = campaignHook != null ? campaignHook.build() : null; } @Override public final Builder campaignHook(CampaignHook campaignHook) { this.campaignHook = campaignHook; 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 CampaignLimits.Builder getLimits() { return limits != null ? limits.toBuilder() : null; } public final void setLimits(CampaignLimits.BuilderImpl limits) { this.limits = limits != null ? limits.build() : null; } @Override public final Builder limits(CampaignLimits limits) { this.limits = limits; 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 ApplicationSettingsJourneyLimits.Builder getJourneyLimits() { return journeyLimits != null ? journeyLimits.toBuilder() : null; } public final void setJourneyLimits(ApplicationSettingsJourneyLimits.BuilderImpl journeyLimits) { this.journeyLimits = journeyLimits != null ? journeyLimits.build() : null; } @Override public final Builder journeyLimits(ApplicationSettingsJourneyLimits journeyLimits) { this.journeyLimits = journeyLimits; return this; } @Override public ApplicationSettingsResource build() { return new ApplicationSettingsResource(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy