Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.pinpoint.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* Activity definition
*/
@Generated("software.amazon.awssdk:codegen")
public final class ActivityResponse implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField APPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::applicationId)).setter(setter(Builder::applicationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationId").build()).build();
private static final SdkField CAMPAIGN_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::campaignId)).setter(setter(Builder::campaignId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CampaignId").build()).build();
private static final SdkField END_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::end)).setter(setter(Builder::end))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("End").build()).build();
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();
private static final SdkField RESULT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::result)).setter(setter(Builder::result))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Result").build()).build();
private static final SdkField SCHEDULED_START_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::scheduledStart)).setter(setter(Builder::scheduledStart))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduledStart").build()).build();
private static final SdkField START_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::start)).setter(setter(Builder::start))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Start").build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::state)).setter(setter(Builder::state))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build();
private static final SdkField SUCCESSFUL_ENDPOINT_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(ActivityResponse::successfulEndpointCount)).setter(setter(Builder::successfulEndpointCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SuccessfulEndpointCount").build())
.build();
private static final SdkField TIMEZONES_COMPLETED_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(ActivityResponse::timezonesCompletedCount)).setter(setter(Builder::timezonesCompletedCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimezonesCompletedCount").build())
.build();
private static final SdkField TIMEZONES_TOTAL_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(ActivityResponse::timezonesTotalCount)).setter(setter(Builder::timezonesTotalCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimezonesTotalCount").build())
.build();
private static final SdkField TOTAL_ENDPOINT_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(ActivityResponse::totalEndpointCount)).setter(setter(Builder::totalEndpointCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalEndpointCount").build())
.build();
private static final SdkField TREATMENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(ActivityResponse::treatmentId)).setter(setter(Builder::treatmentId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TreatmentId").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ID_FIELD,
CAMPAIGN_ID_FIELD, END_FIELD, ID_FIELD, RESULT_FIELD, SCHEDULED_START_FIELD, START_FIELD, STATE_FIELD,
SUCCESSFUL_ENDPOINT_COUNT_FIELD, TIMEZONES_COMPLETED_COUNT_FIELD, TIMEZONES_TOTAL_COUNT_FIELD,
TOTAL_ENDPOINT_COUNT_FIELD, TREATMENT_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String applicationId;
private final String campaignId;
private final String end;
private final String id;
private final String result;
private final String scheduledStart;
private final String start;
private final String state;
private final Integer successfulEndpointCount;
private final Integer timezonesCompletedCount;
private final Integer timezonesTotalCount;
private final Integer totalEndpointCount;
private final String treatmentId;
private ActivityResponse(BuilderImpl builder) {
this.applicationId = builder.applicationId;
this.campaignId = builder.campaignId;
this.end = builder.end;
this.id = builder.id;
this.result = builder.result;
this.scheduledStart = builder.scheduledStart;
this.start = builder.start;
this.state = builder.state;
this.successfulEndpointCount = builder.successfulEndpointCount;
this.timezonesCompletedCount = builder.timezonesCompletedCount;
this.timezonesTotalCount = builder.timezonesTotalCount;
this.totalEndpointCount = builder.totalEndpointCount;
this.treatmentId = builder.treatmentId;
}
/**
* The ID of the application to which the campaign applies.
*
* @return The ID of the application to which the campaign applies.
*/
public String applicationId() {
return applicationId;
}
/**
* The ID of the campaign to which the activity applies.
*
* @return The ID of the campaign to which the activity applies.
*/
public String campaignId() {
return campaignId;
}
/**
* The actual time the activity was marked CANCELLED or COMPLETED. Provided in ISO 8601 format.
*
* @return The actual time the activity was marked CANCELLED or COMPLETED. Provided in ISO 8601 format.
*/
public String end() {
return end;
}
/**
* The unique activity ID.
*
* @return The unique activity ID.
*/
public String id() {
return id;
}
/**
* Indicates whether the activity succeeded.
*
* Valid values: SUCCESS, FAIL
*
* @return Indicates whether the activity succeeded.
*
* Valid values: SUCCESS, FAIL
*/
public String result() {
return result;
}
/**
* The scheduled start time for the activity in ISO 8601 format.
*
* @return The scheduled start time for the activity in ISO 8601 format.
*/
public String scheduledStart() {
return scheduledStart;
}
/**
* The actual start time of the activity in ISO 8601 format.
*
* @return The actual start time of the activity in ISO 8601 format.
*/
public String start() {
return start;
}
/**
* The state of the activity.
*
* Valid values: PENDING, INITIALIZING, RUNNING, PAUSED, CANCELLED, COMPLETED
*
* @return The state of the activity.
*
* Valid values: PENDING, INITIALIZING, RUNNING, PAUSED, CANCELLED, COMPLETED
*/
public String state() {
return state;
}
/**
* The total number of endpoints to which the campaign successfully delivered messages.
*
* @return The total number of endpoints to which the campaign successfully delivered messages.
*/
public Integer successfulEndpointCount() {
return successfulEndpointCount;
}
/**
* The total number of timezones completed.
*
* @return The total number of timezones completed.
*/
public Integer timezonesCompletedCount() {
return timezonesCompletedCount;
}
/**
* The total number of unique timezones present in the segment.
*
* @return The total number of unique timezones present in the segment.
*/
public Integer timezonesTotalCount() {
return timezonesTotalCount;
}
/**
* The total number of endpoints to which the campaign attempts to deliver messages.
*
* @return The total number of endpoints to which the campaign attempts to deliver messages.
*/
public Integer totalEndpointCount() {
return totalEndpointCount;
}
/**
* The ID of a variation of the campaign used for A/B testing.
*
* @return The ID of a variation of the campaign used for A/B testing.
*/
public String treatmentId() {
return treatmentId;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(applicationId());
hashCode = 31 * hashCode + Objects.hashCode(campaignId());
hashCode = 31 * hashCode + Objects.hashCode(end());
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(result());
hashCode = 31 * hashCode + Objects.hashCode(scheduledStart());
hashCode = 31 * hashCode + Objects.hashCode(start());
hashCode = 31 * hashCode + Objects.hashCode(state());
hashCode = 31 * hashCode + Objects.hashCode(successfulEndpointCount());
hashCode = 31 * hashCode + Objects.hashCode(timezonesCompletedCount());
hashCode = 31 * hashCode + Objects.hashCode(timezonesTotalCount());
hashCode = 31 * hashCode + Objects.hashCode(totalEndpointCount());
hashCode = 31 * hashCode + Objects.hashCode(treatmentId());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ActivityResponse)) {
return false;
}
ActivityResponse other = (ActivityResponse) obj;
return Objects.equals(applicationId(), other.applicationId()) && Objects.equals(campaignId(), other.campaignId())
&& Objects.equals(end(), other.end()) && Objects.equals(id(), other.id())
&& Objects.equals(result(), other.result()) && Objects.equals(scheduledStart(), other.scheduledStart())
&& Objects.equals(start(), other.start()) && Objects.equals(state(), other.state())
&& Objects.equals(successfulEndpointCount(), other.successfulEndpointCount())
&& Objects.equals(timezonesCompletedCount(), other.timezonesCompletedCount())
&& Objects.equals(timezonesTotalCount(), other.timezonesTotalCount())
&& Objects.equals(totalEndpointCount(), other.totalEndpointCount())
&& Objects.equals(treatmentId(), other.treatmentId());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public String toString() {
return ToString.builder("ActivityResponse").add("ApplicationId", applicationId()).add("CampaignId", campaignId())
.add("End", end()).add("Id", id()).add("Result", result()).add("ScheduledStart", scheduledStart())
.add("Start", start()).add("State", state()).add("SuccessfulEndpointCount", successfulEndpointCount())
.add("TimezonesCompletedCount", timezonesCompletedCount()).add("TimezonesTotalCount", timezonesTotalCount())
.add("TotalEndpointCount", totalEndpointCount()).add("TreatmentId", treatmentId()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ApplicationId":
return Optional.ofNullable(clazz.cast(applicationId()));
case "CampaignId":
return Optional.ofNullable(clazz.cast(campaignId()));
case "End":
return Optional.ofNullable(clazz.cast(end()));
case "Id":
return Optional.ofNullable(clazz.cast(id()));
case "Result":
return Optional.ofNullable(clazz.cast(result()));
case "ScheduledStart":
return Optional.ofNullable(clazz.cast(scheduledStart()));
case "Start":
return Optional.ofNullable(clazz.cast(start()));
case "State":
return Optional.ofNullable(clazz.cast(state()));
case "SuccessfulEndpointCount":
return Optional.ofNullable(clazz.cast(successfulEndpointCount()));
case "TimezonesCompletedCount":
return Optional.ofNullable(clazz.cast(timezonesCompletedCount()));
case "TimezonesTotalCount":
return Optional.ofNullable(clazz.cast(timezonesTotalCount()));
case "TotalEndpointCount":
return Optional.ofNullable(clazz.cast(totalEndpointCount()));
case "TreatmentId":
return Optional.ofNullable(clazz.cast(treatmentId()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function