Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.pinpoint.model.JourneyRunExecutionActivityMetricsResponse 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
/*
* 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.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Provides the results of a query that retrieved the data for a standard execution metric that applies to a journey
* activity for a particular journey run, and provides information about that query.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class JourneyRunExecutionActivityMetricsResponse implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACTIVITY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ActivityType").getter(getter(JourneyRunExecutionActivityMetricsResponse::activityType))
.setter(setter(Builder::activityType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActivityType").build()).build();
private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ApplicationId").getter(getter(JourneyRunExecutionActivityMetricsResponse::applicationId))
.setter(setter(Builder::applicationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationId").build()).build();
private static final SdkField JOURNEY_ACTIVITY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("JourneyActivityId").getter(getter(JourneyRunExecutionActivityMetricsResponse::journeyActivityId))
.setter(setter(Builder::journeyActivityId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JourneyActivityId").build()).build();
private static final SdkField JOURNEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("JourneyId").getter(getter(JourneyRunExecutionActivityMetricsResponse::journeyId))
.setter(setter(Builder::journeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JourneyId").build()).build();
private static final SdkField LAST_EVALUATED_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastEvaluatedTime").getter(getter(JourneyRunExecutionActivityMetricsResponse::lastEvaluatedTime))
.setter(setter(Builder::lastEvaluatedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastEvaluatedTime").build()).build();
private static final SdkField> METRICS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Metrics")
.getter(getter(JourneyRunExecutionActivityMetricsResponse::metrics))
.setter(setter(Builder::metrics))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Metrics").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 RUN_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("RunId")
.getter(getter(JourneyRunExecutionActivityMetricsResponse::runId)).setter(setter(Builder::runId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RunId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTIVITY_TYPE_FIELD,
APPLICATION_ID_FIELD, JOURNEY_ACTIVITY_ID_FIELD, JOURNEY_ID_FIELD, LAST_EVALUATED_TIME_FIELD, METRICS_FIELD,
RUN_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String activityType;
private final String applicationId;
private final String journeyActivityId;
private final String journeyId;
private final String lastEvaluatedTime;
private final Map metrics;
private final String runId;
private JourneyRunExecutionActivityMetricsResponse(BuilderImpl builder) {
this.activityType = builder.activityType;
this.applicationId = builder.applicationId;
this.journeyActivityId = builder.journeyActivityId;
this.journeyId = builder.journeyId;
this.lastEvaluatedTime = builder.lastEvaluatedTime;
this.metrics = builder.metrics;
this.runId = builder.runId;
}
/**
*
* The type of activity that the metric applies to. Possible values are:
*
*
*
*
* CONDITIONAL_SPLIT – For a yes/no split activity, which is an activity that sends participants down one of two
* paths in a journey.
*
*
*
*
* HOLDOUT – For a holdout activity, which is an activity that stops a journey for a specified percentage of
* participants.
*
*
*
*
* MESSAGE – For an email activity, which is an activity that sends an email message to participants.
*
*
*
*
* MULTI_CONDITIONAL_SPLIT – For a multivariate split activity, which is an activity that sends participants down
* one of as many as five paths in a journey.
*
*
*
*
* RANDOM_SPLIT – For a random split activity, which is an activity that sends specified percentages of participants
* down one of as many as five paths in a journey.
*
*
*
*
* WAIT – For a wait activity, which is an activity that waits for a certain amount of time or until a specific date
* and time before moving participants to the next activity in a journey.
*
*
*
*
* @return The type of activity that the metric applies to. Possible values are:
*
*
*
* CONDITIONAL_SPLIT – For a yes/no split activity, which is an activity that sends participants down one of
* two paths in a journey.
*
*
*
*
* HOLDOUT – For a holdout activity, which is an activity that stops a journey for a specified percentage of
* participants.
*
*
*
*
* MESSAGE – For an email activity, which is an activity that sends an email message to participants.
*
*
*
*
* MULTI_CONDITIONAL_SPLIT – For a multivariate split activity, which is an activity that sends participants
* down one of as many as five paths in a journey.
*
*
*
*
* RANDOM_SPLIT – For a random split activity, which is an activity that sends specified percentages of
* participants down one of as many as five paths in a journey.
*
*
*
*
* WAIT – For a wait activity, which is an activity that waits for a certain amount of time or until a
* specific date and time before moving participants to the next activity in a journey.
*
*
*/
public final String activityType() {
return activityType;
}
/**
*
* The unique identifier for the application that the metric applies to.
*
*
* @return The unique identifier for the application that the metric applies to.
*/
public final String applicationId() {
return applicationId;
}
/**
*
* The unique identifier for the activity that the metric applies to.
*
*
* @return The unique identifier for the activity that the metric applies to.
*/
public final String journeyActivityId() {
return journeyActivityId;
}
/**
*
* The unique identifier for the journey that the metric applies to.
*
*
* @return The unique identifier for the journey that the metric applies to.
*/
public final String journeyId() {
return journeyId;
}
/**
*
* The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the execution status of the activity
* for this journey run and updated the data for the metric.
*
*
* @return The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the execution status of the
* activity for this journey run and updated the data for the metric.
*/
public final String lastEvaluatedTime() {
return lastEvaluatedTime;
}
/**
* For responses, this returns true if the service returned a value for the Metrics 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 hasMetrics() {
return metrics != null && !(metrics instanceof SdkAutoConstructMap);
}
/**
*
* A JSON object that contains the results of the query. For information about the structure and contents of the
* results, see see Standard
* Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide .
*
*
* 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 #hasMetrics} method.
*
*
* @return A JSON object that contains the results of the query. For information about the structure and contents of
* the results, see see Standard Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide .
*/
public final Map metrics() {
return metrics;
}
/**
*
* The unique identifier for the journey run that the metric applies to.
*
*
* @return The unique identifier for the journey run that the metric applies to.
*/
public final String runId() {
return runId;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(activityType());
hashCode = 31 * hashCode + Objects.hashCode(applicationId());
hashCode = 31 * hashCode + Objects.hashCode(journeyActivityId());
hashCode = 31 * hashCode + Objects.hashCode(journeyId());
hashCode = 31 * hashCode + Objects.hashCode(lastEvaluatedTime());
hashCode = 31 * hashCode + Objects.hashCode(hasMetrics() ? metrics() : null);
hashCode = 31 * hashCode + Objects.hashCode(runId());
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 JourneyRunExecutionActivityMetricsResponse)) {
return false;
}
JourneyRunExecutionActivityMetricsResponse other = (JourneyRunExecutionActivityMetricsResponse) obj;
return Objects.equals(activityType(), other.activityType()) && Objects.equals(applicationId(), other.applicationId())
&& Objects.equals(journeyActivityId(), other.journeyActivityId())
&& Objects.equals(journeyId(), other.journeyId())
&& Objects.equals(lastEvaluatedTime(), other.lastEvaluatedTime()) && hasMetrics() == other.hasMetrics()
&& Objects.equals(metrics(), other.metrics()) && Objects.equals(runId(), other.runId());
}
/**
* 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("JourneyRunExecutionActivityMetricsResponse").add("ActivityType", activityType())
.add("ApplicationId", applicationId()).add("JourneyActivityId", journeyActivityId())
.add("JourneyId", journeyId()).add("LastEvaluatedTime", lastEvaluatedTime())
.add("Metrics", hasMetrics() ? metrics() : null).add("RunId", runId()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ActivityType":
return Optional.ofNullable(clazz.cast(activityType()));
case "ApplicationId":
return Optional.ofNullable(clazz.cast(applicationId()));
case "JourneyActivityId":
return Optional.ofNullable(clazz.cast(journeyActivityId()));
case "JourneyId":
return Optional.ofNullable(clazz.cast(journeyId()));
case "LastEvaluatedTime":
return Optional.ofNullable(clazz.cast(lastEvaluatedTime()));
case "Metrics":
return Optional.ofNullable(clazz.cast(metrics()));
case "RunId":
return Optional.ofNullable(clazz.cast(runId()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((JourneyRunExecutionActivityMetricsResponse) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The type of activity that the metric applies to. Possible values are:
*
*
*
*
* CONDITIONAL_SPLIT – For a yes/no split activity, which is an activity that sends participants down one of two
* paths in a journey.
*
*
*
*
* HOLDOUT – For a holdout activity, which is an activity that stops a journey for a specified percentage of
* participants.
*
*
*
*
* MESSAGE – For an email activity, which is an activity that sends an email message to participants.
*
*
*
*
* MULTI_CONDITIONAL_SPLIT – For a multivariate split activity, which is an activity that sends participants
* down one of as many as five paths in a journey.
*
*
*
*
* RANDOM_SPLIT – For a random split activity, which is an activity that sends specified percentages of
* participants down one of as many as five paths in a journey.
*
*
*
*
* WAIT – For a wait activity, which is an activity that waits for a certain amount of time or until a specific
* date and time before moving participants to the next activity in a journey.
*
*
*
*
* @param activityType
* The type of activity that the metric applies to. Possible values are:
*
*
*
* CONDITIONAL_SPLIT – For a yes/no split activity, which is an activity that sends participants down one
* of two paths in a journey.
*
*
*
*
* HOLDOUT – For a holdout activity, which is an activity that stops a journey for a specified percentage
* of participants.
*
*
*
*
* MESSAGE – For an email activity, which is an activity that sends an email message to participants.
*
*
*
*
* MULTI_CONDITIONAL_SPLIT – For a multivariate split activity, which is an activity that sends
* participants down one of as many as five paths in a journey.
*
*
*
*
* RANDOM_SPLIT – For a random split activity, which is an activity that sends specified percentages of
* participants down one of as many as five paths in a journey.
*
*
*
*
* WAIT – For a wait activity, which is an activity that waits for a certain amount of time or until a
* specific date and time before moving participants to the next activity in a journey.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder activityType(String activityType);
/**
*
* The unique identifier for the application that the metric applies to.
*
*
* @param applicationId
* The unique identifier for the application that the metric applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder applicationId(String applicationId);
/**
*
* The unique identifier for the activity that the metric applies to.
*
*
* @param journeyActivityId
* The unique identifier for the activity that the metric applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder journeyActivityId(String journeyActivityId);
/**
*
* The unique identifier for the journey that the metric applies to.
*
*
* @param journeyId
* The unique identifier for the journey that the metric applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder journeyId(String journeyId);
/**
*
* The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the execution status of the
* activity for this journey run and updated the data for the metric.
*
*
* @param lastEvaluatedTime
* The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated the execution status of the
* activity for this journey run and updated the data for the metric.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lastEvaluatedTime(String lastEvaluatedTime);
/**
*
* A JSON object that contains the results of the query. For information about the structure and contents of the
* results, see see Standard
* Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide .
*
*
* @param metrics
* A JSON object that contains the results of the query. For information about the structure and contents
* of the results, see see Standard Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder metrics(Map metrics);
/**
*
* The unique identifier for the journey run that the metric applies to.
*
*
* @param runId
* The unique identifier for the journey run that the metric applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder runId(String runId);
}
static final class BuilderImpl implements Builder {
private String activityType;
private String applicationId;
private String journeyActivityId;
private String journeyId;
private String lastEvaluatedTime;
private Map metrics = DefaultSdkAutoConstructMap.getInstance();
private String runId;
private BuilderImpl() {
}
private BuilderImpl(JourneyRunExecutionActivityMetricsResponse model) {
activityType(model.activityType);
applicationId(model.applicationId);
journeyActivityId(model.journeyActivityId);
journeyId(model.journeyId);
lastEvaluatedTime(model.lastEvaluatedTime);
metrics(model.metrics);
runId(model.runId);
}
public final String getActivityType() {
return activityType;
}
public final void setActivityType(String activityType) {
this.activityType = activityType;
}
@Override
public final Builder activityType(String activityType) {
this.activityType = activityType;
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 getJourneyActivityId() {
return journeyActivityId;
}
public final void setJourneyActivityId(String journeyActivityId) {
this.journeyActivityId = journeyActivityId;
}
@Override
public final Builder journeyActivityId(String journeyActivityId) {
this.journeyActivityId = journeyActivityId;
return this;
}
public final String getJourneyId() {
return journeyId;
}
public final void setJourneyId(String journeyId) {
this.journeyId = journeyId;
}
@Override
public final Builder journeyId(String journeyId) {
this.journeyId = journeyId;
return this;
}
public final String getLastEvaluatedTime() {
return lastEvaluatedTime;
}
public final void setLastEvaluatedTime(String lastEvaluatedTime) {
this.lastEvaluatedTime = lastEvaluatedTime;
}
@Override
public final Builder lastEvaluatedTime(String lastEvaluatedTime) {
this.lastEvaluatedTime = lastEvaluatedTime;
return this;
}
public final Map getMetrics() {
if (metrics instanceof SdkAutoConstructMap) {
return null;
}
return metrics;
}
public final void setMetrics(Map metrics) {
this.metrics = MapOf__stringCopier.copy(metrics);
}
@Override
public final Builder metrics(Map metrics) {
this.metrics = MapOf__stringCopier.copy(metrics);
return this;
}
public final String getRunId() {
return runId;
}
public final void setRunId(String runId) {
this.runId = runId;
}
@Override
public final Builder runId(String runId) {
this.runId = runId;
return this;
}
@Override
public JourneyRunExecutionActivityMetricsResponse build() {
return new JourneyRunExecutionActivityMetricsResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}