/* * Copyright 2018-2023 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 com.amazonaws.services.pinpoint.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Provides information about an activity that was performed by a campaign. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ActivityResponse implements Serializable, Cloneable, StructuredPojo { /** *

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

*/ private String applicationId; /** *

* The unique identifier for the campaign that the activity applies to. *

*/ private String campaignId; /** *

* The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. *

*/ private String end; /** *

* The unique identifier for the activity. *

*/ private String id; /** *

* Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. *

*/ private String result; /** *

* The scheduled start time, in ISO 8601 format, for the activity. *

*/ private String scheduledStart; /** *

* The actual start time, in ISO 8601 format, of the activity. *

*/ private String start; /** *

* The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, CANCELLED, and * COMPLETED. *

*/ private String state; /** *

* The total number of endpoints that the campaign successfully delivered messages to. *

*/ private Integer successfulEndpointCount; /** *

* The total number of time zones that were completed. *

*/ private Integer timezonesCompletedCount; /** *

* The total number of unique time zones that are in the segment for the campaign. *

*/ private Integer timezonesTotalCount; /** *

* The total number of endpoints that the campaign attempted to deliver messages to. *

*/ private Integer totalEndpointCount; /** *

* The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation of a * campaign that's used for A/B testing of a campaign. *

*/ private String treatmentId; /** *

* A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, see Standard * Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide. *

*/ private java.util.Map executionMetrics; /** *

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

* * @param applicationId * The unique identifier for the application that the campaign applies to. */ public void setApplicationId(String applicationId) { this.applicationId = applicationId; } /** *

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

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

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

* * @param applicationId * The unique identifier for the application that the campaign applies to. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withApplicationId(String applicationId) { setApplicationId(applicationId); return this; } /** *

* The unique identifier for the campaign that the activity applies to. *

* * @param campaignId * The unique identifier for the campaign that the activity applies to. */ public void setCampaignId(String campaignId) { this.campaignId = campaignId; } /** *

* The unique identifier for the campaign that the activity applies to. *

* * @return The unique identifier for the campaign that the activity applies to. */ public String getCampaignId() { return this.campaignId; } /** *

* The unique identifier for the campaign that the activity applies to. *

* * @param campaignId * The unique identifier for the campaign that the activity applies to. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withCampaignId(String campaignId) { setCampaignId(campaignId); return this; } /** *

* The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. *

* * @param end * The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. */ public void setEnd(String end) { this.end = end; } /** *

* The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. *

* * @return The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. */ public String getEnd() { return this.end; } /** *

* The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. *

* * @param end * The actual time, in ISO 8601 format, when the activity was marked CANCELLED or COMPLETED. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withEnd(String end) { setEnd(end); return this; } /** *

* The unique identifier for the activity. *

* * @param id * The unique identifier for the activity. */ public void setId(String id) { this.id = id; } /** *

* The unique identifier for the activity. *

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

* The unique identifier for the activity. *

* * @param id * The unique identifier for the activity. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withId(String id) { setId(id); return this; } /** *

* Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. *

* * @param result * Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. */ public void setResult(String result) { this.result = result; } /** *

* Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. *

* * @return Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. */ public String getResult() { return this.result; } /** *

* Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. *

* * @param result * Specifies whether the activity succeeded. Possible values are SUCCESS and FAIL. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withResult(String result) { setResult(result); return this; } /** *

* The scheduled start time, in ISO 8601 format, for the activity. *

* * @param scheduledStart * The scheduled start time, in ISO 8601 format, for the activity. */ public void setScheduledStart(String scheduledStart) { this.scheduledStart = scheduledStart; } /** *

* The scheduled start time, in ISO 8601 format, for the activity. *

* * @return The scheduled start time, in ISO 8601 format, for the activity. */ public String getScheduledStart() { return this.scheduledStart; } /** *

* The scheduled start time, in ISO 8601 format, for the activity. *

* * @param scheduledStart * The scheduled start time, in ISO 8601 format, for the activity. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withScheduledStart(String scheduledStart) { setScheduledStart(scheduledStart); return this; } /** *

* The actual start time, in ISO 8601 format, of the activity. *

* * @param start * The actual start time, in ISO 8601 format, of the activity. */ public void setStart(String start) { this.start = start; } /** *

* The actual start time, in ISO 8601 format, of the activity. *

* * @return The actual start time, in ISO 8601 format, of the activity. */ public String getStart() { return this.start; } /** *

* The actual start time, in ISO 8601 format, of the activity. *

* * @param start * The actual start time, in ISO 8601 format, of the activity. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withStart(String start) { setStart(start); return this; } /** *

* The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, CANCELLED, and * COMPLETED. *

* * @param state * The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, * CANCELLED, and COMPLETED. */ public void setState(String state) { this.state = state; } /** *

* The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, CANCELLED, and * COMPLETED. *

* * @return The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, * CANCELLED, and COMPLETED. */ public String getState() { return this.state; } /** *

* The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, CANCELLED, and * COMPLETED. *

* * @param state * The current status of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, PAUSED, * CANCELLED, and COMPLETED. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withState(String state) { setState(state); return this; } /** *

* The total number of endpoints that the campaign successfully delivered messages to. *

* * @param successfulEndpointCount * The total number of endpoints that the campaign successfully delivered messages to. */ public void setSuccessfulEndpointCount(Integer successfulEndpointCount) { this.successfulEndpointCount = successfulEndpointCount; } /** *

* The total number of endpoints that the campaign successfully delivered messages to. *

* * @return The total number of endpoints that the campaign successfully delivered messages to. */ public Integer getSuccessfulEndpointCount() { return this.successfulEndpointCount; } /** *

* The total number of endpoints that the campaign successfully delivered messages to. *

* * @param successfulEndpointCount * The total number of endpoints that the campaign successfully delivered messages to. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withSuccessfulEndpointCount(Integer successfulEndpointCount) { setSuccessfulEndpointCount(successfulEndpointCount); return this; } /** *

* The total number of time zones that were completed. *

* * @param timezonesCompletedCount * The total number of time zones that were completed. */ public void setTimezonesCompletedCount(Integer timezonesCompletedCount) { this.timezonesCompletedCount = timezonesCompletedCount; } /** *

* The total number of time zones that were completed. *

* * @return The total number of time zones that were completed. */ public Integer getTimezonesCompletedCount() { return this.timezonesCompletedCount; } /** *

* The total number of time zones that were completed. *

* * @param timezonesCompletedCount * The total number of time zones that were completed. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withTimezonesCompletedCount(Integer timezonesCompletedCount) { setTimezonesCompletedCount(timezonesCompletedCount); return this; } /** *

* The total number of unique time zones that are in the segment for the campaign. *

* * @param timezonesTotalCount * The total number of unique time zones that are in the segment for the campaign. */ public void setTimezonesTotalCount(Integer timezonesTotalCount) { this.timezonesTotalCount = timezonesTotalCount; } /** *

* The total number of unique time zones that are in the segment for the campaign. *

* * @return The total number of unique time zones that are in the segment for the campaign. */ public Integer getTimezonesTotalCount() { return this.timezonesTotalCount; } /** *

* The total number of unique time zones that are in the segment for the campaign. *

* * @param timezonesTotalCount * The total number of unique time zones that are in the segment for the campaign. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withTimezonesTotalCount(Integer timezonesTotalCount) { setTimezonesTotalCount(timezonesTotalCount); return this; } /** *

* The total number of endpoints that the campaign attempted to deliver messages to. *

* * @param totalEndpointCount * The total number of endpoints that the campaign attempted to deliver messages to. */ public void setTotalEndpointCount(Integer totalEndpointCount) { this.totalEndpointCount = totalEndpointCount; } /** *

* The total number of endpoints that the campaign attempted to deliver messages to. *

* * @return The total number of endpoints that the campaign attempted to deliver messages to. */ public Integer getTotalEndpointCount() { return this.totalEndpointCount; } /** *

* The total number of endpoints that the campaign attempted to deliver messages to. *

* * @param totalEndpointCount * The total number of endpoints that the campaign attempted to deliver messages to. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withTotalEndpointCount(Integer totalEndpointCount) { setTotalEndpointCount(totalEndpointCount); return this; } /** *

* The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation of a * campaign that's used for A/B testing of a campaign. *

* * @param treatmentId * The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation * of a campaign that's used for A/B testing of a campaign. */ public void setTreatmentId(String treatmentId) { this.treatmentId = treatmentId; } /** *

* The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation of a * campaign that's used for A/B testing of a campaign. *

* * @return The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation * of a campaign that's used for A/B testing of a campaign. */ public String getTreatmentId() { return this.treatmentId; } /** *

* The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation of a * campaign that's used for A/B testing of a campaign. *

* * @param treatmentId * The unique identifier for the campaign treatment that the activity applies to. A treatment is a variation * of a campaign that's used for A/B testing of a campaign. * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse withTreatmentId(String treatmentId) { setTreatmentId(treatmentId); return this; } /** *

* A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, see Standard * Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide. *

* * @return A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, see Standard Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide. */ public java.util.Map getExecutionMetrics() { return executionMetrics; } /** *

* A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, see Standard * Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide. *

* * @param executionMetrics * A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, see Standard Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide. */ public void setExecutionMetrics(java.util.Map executionMetrics) { this.executionMetrics = executionMetrics; } /** *

* A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, see Standard * Amazon Pinpoint analytics metrics in the Amazon Pinpoint Developer Guide. *

* * @param executionMetrics * A JSON object that contains metrics relating to the campaign execution for this campaign activity. For * information about the structure and contents of the results, 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. */ public ActivityResponse withExecutionMetrics(java.util.Map executionMetrics) { setExecutionMetrics(executionMetrics); return this; } /** * Add a single ExecutionMetrics entry * * @see ActivityResponse#withExecutionMetrics * @returns a reference to this object so that method calls can be chained together. */ public ActivityResponse addExecutionMetricsEntry(String key, String value) { if (null == this.executionMetrics) { this.executionMetrics = new java.util.HashMap(); } if (this.executionMetrics.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.executionMetrics.put(key, value); return this; } /** * Removes all the entries added into ExecutionMetrics. * * @return Returns a reference to this object so that method calls can be chained together. */ public ActivityResponse clearExecutionMetricsEntries() { this.executionMetrics = null; return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getApplicationId() != null) sb.append("ApplicationId: ").append(getApplicationId()).append(","); if (getCampaignId() != null) sb.append("CampaignId: ").append(getCampaignId()).append(","); if (getEnd() != null) sb.append("End: ").append(getEnd()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getResult() != null) sb.append("Result: ").append(getResult()).append(","); if (getScheduledStart() != null) sb.append("ScheduledStart: ").append(getScheduledStart()).append(","); if (getStart() != null) sb.append("Start: ").append(getStart()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getSuccessfulEndpointCount() != null) sb.append("SuccessfulEndpointCount: ").append(getSuccessfulEndpointCount()).append(","); if (getTimezonesCompletedCount() != null) sb.append("TimezonesCompletedCount: ").append(getTimezonesCompletedCount()).append(","); if (getTimezonesTotalCount() != null) sb.append("TimezonesTotalCount: ").append(getTimezonesTotalCount()).append(","); if (getTotalEndpointCount() != null) sb.append("TotalEndpointCount: ").append(getTotalEndpointCount()).append(","); if (getTreatmentId() != null) sb.append("TreatmentId: ").append(getTreatmentId()).append(","); if (getExecutionMetrics() != null) sb.append("ExecutionMetrics: ").append(getExecutionMetrics()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ActivityResponse == false) return false; ActivityResponse other = (ActivityResponse) obj; if (other.getApplicationId() == null ^ this.getApplicationId() == null) return false; if (other.getApplicationId() != null && other.getApplicationId().equals(this.getApplicationId()) == false) return false; if (other.getCampaignId() == null ^ this.getCampaignId() == null) return false; if (other.getCampaignId() != null && other.getCampaignId().equals(this.getCampaignId()) == false) return false; if (other.getEnd() == null ^ this.getEnd() == null) return false; if (other.getEnd() != null && other.getEnd().equals(this.getEnd()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getResult() == null ^ this.getResult() == null) return false; if (other.getResult() != null && other.getResult().equals(this.getResult()) == false) return false; if (other.getScheduledStart() == null ^ this.getScheduledStart() == null) return false; if (other.getScheduledStart() != null && other.getScheduledStart().equals(this.getScheduledStart()) == false) return false; if (other.getStart() == null ^ this.getStart() == null) return false; if (other.getStart() != null && other.getStart().equals(this.getStart()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getSuccessfulEndpointCount() == null ^ this.getSuccessfulEndpointCount() == null) return false; if (other.getSuccessfulEndpointCount() != null && other.getSuccessfulEndpointCount().equals(this.getSuccessfulEndpointCount()) == false) return false; if (other.getTimezonesCompletedCount() == null ^ this.getTimezonesCompletedCount() == null) return false; if (other.getTimezonesCompletedCount() != null && other.getTimezonesCompletedCount().equals(this.getTimezonesCompletedCount()) == false) return false; if (other.getTimezonesTotalCount() == null ^ this.getTimezonesTotalCount() == null) return false; if (other.getTimezonesTotalCount() != null && other.getTimezonesTotalCount().equals(this.getTimezonesTotalCount()) == false) return false; if (other.getTotalEndpointCount() == null ^ this.getTotalEndpointCount() == null) return false; if (other.getTotalEndpointCount() != null && other.getTotalEndpointCount().equals(this.getTotalEndpointCount()) == false) return false; if (other.getTreatmentId() == null ^ this.getTreatmentId() == null) return false; if (other.getTreatmentId() != null && other.getTreatmentId().equals(this.getTreatmentId()) == false) return false; if (other.getExecutionMetrics() == null ^ this.getExecutionMetrics() == null) return false; if (other.getExecutionMetrics() != null && other.getExecutionMetrics().equals(this.getExecutionMetrics()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getApplicationId() == null) ? 0 : getApplicationId().hashCode()); hashCode = prime * hashCode + ((getCampaignId() == null) ? 0 : getCampaignId().hashCode()); hashCode = prime * hashCode + ((getEnd() == null) ? 0 : getEnd().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getResult() == null) ? 0 : getResult().hashCode()); hashCode = prime * hashCode + ((getScheduledStart() == null) ? 0 : getScheduledStart().hashCode()); hashCode = prime * hashCode + ((getStart() == null) ? 0 : getStart().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getSuccessfulEndpointCount() == null) ? 0 : getSuccessfulEndpointCount().hashCode()); hashCode = prime * hashCode + ((getTimezonesCompletedCount() == null) ? 0 : getTimezonesCompletedCount().hashCode()); hashCode = prime * hashCode + ((getTimezonesTotalCount() == null) ? 0 : getTimezonesTotalCount().hashCode()); hashCode = prime * hashCode + ((getTotalEndpointCount() == null) ? 0 : getTotalEndpointCount().hashCode()); hashCode = prime * hashCode + ((getTreatmentId() == null) ? 0 : getTreatmentId().hashCode()); hashCode = prime * hashCode + ((getExecutionMetrics() == null) ? 0 : getExecutionMetrics().hashCode()); return hashCode; } @Override public ActivityResponse clone() { try { return (ActivityResponse) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.pinpoint.model.transform.ActivityResponseMarshaller.getInstance().marshall(this, protocolMarshaller); } }