com.amazonaws.services.ssmincidents.model.IncidentRecord Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ssmincidents Show documentation
/*
* Copyright 2019-2024 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.ssmincidents.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The record of the incident that's created when an incident occurs.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class IncidentRecord implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) of the incident record.
*
*/
private String arn;
/**
*
* The runbook, or automation document, that's run at the beginning of the incident.
*
*/
private java.util.List automationExecutions;
/**
*
* The chat channel used for collaboration during an incident.
*
*/
private ChatChannel chatChannel;
/**
*
* The timestamp for when Incident Manager created the incident record.
*
*/
private java.util.Date creationTime;
/**
*
* The string Incident Manager uses to prevent duplicate incidents from being created by the same incident in the
* same account.
*
*/
private String dedupeString;
/**
*
* The impact of the incident on customers and applications.
*
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
*
*/
private Integer impact;
/**
*
* Details about the action that started the incident.
*
*/
private IncidentRecordSource incidentRecordSource;
/**
*
* Who modified the incident most recently.
*
*/
private String lastModifiedBy;
/**
*
* The timestamp for when the incident was most recently modified.
*
*/
private java.util.Date lastModifiedTime;
/**
*
* The Amazon SNS targets that are notified when updates are made to an incident.
*
*/
private java.util.List notificationTargets;
/**
*
* The timestamp for when the incident was resolved. This appears as a timeline event.
*
*/
private java.util.Date resolvedTime;
/**
*
* The current status of the incident.
*
*/
private String status;
/**
*
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening, and
* context of the incident.
*
*/
private String summary;
/**
*
* The title of the incident.
*
*/
private String title;
/**
*
* The Amazon Resource Name (ARN) of the incident record.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the incident record.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the incident record.
*
*
* @return The Amazon Resource Name (ARN) of the incident record.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the incident record.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the incident record.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The runbook, or automation document, that's run at the beginning of the incident.
*
*
* @return The runbook, or automation document, that's run at the beginning of the incident.
*/
public java.util.List getAutomationExecutions() {
return automationExecutions;
}
/**
*
* The runbook, or automation document, that's run at the beginning of the incident.
*
*
* @param automationExecutions
* The runbook, or automation document, that's run at the beginning of the incident.
*/
public void setAutomationExecutions(java.util.Collection automationExecutions) {
if (automationExecutions == null) {
this.automationExecutions = null;
return;
}
this.automationExecutions = new java.util.ArrayList(automationExecutions);
}
/**
*
* The runbook, or automation document, that's run at the beginning of the incident.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAutomationExecutions(java.util.Collection)} or {@link #withAutomationExecutions(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param automationExecutions
* The runbook, or automation document, that's run at the beginning of the incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withAutomationExecutions(AutomationExecution... automationExecutions) {
if (this.automationExecutions == null) {
setAutomationExecutions(new java.util.ArrayList(automationExecutions.length));
}
for (AutomationExecution ele : automationExecutions) {
this.automationExecutions.add(ele);
}
return this;
}
/**
*
* The runbook, or automation document, that's run at the beginning of the incident.
*
*
* @param automationExecutions
* The runbook, or automation document, that's run at the beginning of the incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withAutomationExecutions(java.util.Collection automationExecutions) {
setAutomationExecutions(automationExecutions);
return this;
}
/**
*
* The chat channel used for collaboration during an incident.
*
*
* @param chatChannel
* The chat channel used for collaboration during an incident.
*/
public void setChatChannel(ChatChannel chatChannel) {
this.chatChannel = chatChannel;
}
/**
*
* The chat channel used for collaboration during an incident.
*
*
* @return The chat channel used for collaboration during an incident.
*/
public ChatChannel getChatChannel() {
return this.chatChannel;
}
/**
*
* The chat channel used for collaboration during an incident.
*
*
* @param chatChannel
* The chat channel used for collaboration during an incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withChatChannel(ChatChannel chatChannel) {
setChatChannel(chatChannel);
return this;
}
/**
*
* The timestamp for when Incident Manager created the incident record.
*
*
* @param creationTime
* The timestamp for when Incident Manager created the incident record.
*/
public void setCreationTime(java.util.Date creationTime) {
this.creationTime = creationTime;
}
/**
*
* The timestamp for when Incident Manager created the incident record.
*
*
* @return The timestamp for when Incident Manager created the incident record.
*/
public java.util.Date getCreationTime() {
return this.creationTime;
}
/**
*
* The timestamp for when Incident Manager created the incident record.
*
*
* @param creationTime
* The timestamp for when Incident Manager created the incident record.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withCreationTime(java.util.Date creationTime) {
setCreationTime(creationTime);
return this;
}
/**
*
* The string Incident Manager uses to prevent duplicate incidents from being created by the same incident in the
* same account.
*
*
* @param dedupeString
* The string Incident Manager uses to prevent duplicate incidents from being created by the same incident in
* the same account.
*/
public void setDedupeString(String dedupeString) {
this.dedupeString = dedupeString;
}
/**
*
* The string Incident Manager uses to prevent duplicate incidents from being created by the same incident in the
* same account.
*
*
* @return The string Incident Manager uses to prevent duplicate incidents from being created by the same incident
* in the same account.
*/
public String getDedupeString() {
return this.dedupeString;
}
/**
*
* The string Incident Manager uses to prevent duplicate incidents from being created by the same incident in the
* same account.
*
*
* @param dedupeString
* The string Incident Manager uses to prevent duplicate incidents from being created by the same incident in
* the same account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withDedupeString(String dedupeString) {
setDedupeString(dedupeString);
return this;
}
/**
*
* The impact of the incident on customers and applications.
*
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
*
*
* @param impact
* The impact of the incident on customers and applications.
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
*/
public void setImpact(Integer impact) {
this.impact = impact;
}
/**
*
* The impact of the incident on customers and applications.
*
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
*
*
* @return The impact of the incident on customers and applications.
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
*/
public Integer getImpact() {
return this.impact;
}
/**
*
* The impact of the incident on customers and applications.
*
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
*
*
* @param impact
* The impact of the incident on customers and applications.
*
* Supported impact codes
*
*
* -
*
* 1
- Critical
*
*
* -
*
* 2
- High
*
*
* -
*
* 3
- Medium
*
*
* -
*
* 4
- Low
*
*
* -
*
* 5
- No Impact
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withImpact(Integer impact) {
setImpact(impact);
return this;
}
/**
*
* Details about the action that started the incident.
*
*
* @param incidentRecordSource
* Details about the action that started the incident.
*/
public void setIncidentRecordSource(IncidentRecordSource incidentRecordSource) {
this.incidentRecordSource = incidentRecordSource;
}
/**
*
* Details about the action that started the incident.
*
*
* @return Details about the action that started the incident.
*/
public IncidentRecordSource getIncidentRecordSource() {
return this.incidentRecordSource;
}
/**
*
* Details about the action that started the incident.
*
*
* @param incidentRecordSource
* Details about the action that started the incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withIncidentRecordSource(IncidentRecordSource incidentRecordSource) {
setIncidentRecordSource(incidentRecordSource);
return this;
}
/**
*
* Who modified the incident most recently.
*
*
* @param lastModifiedBy
* Who modified the incident most recently.
*/
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
/**
*
* Who modified the incident most recently.
*
*
* @return Who modified the incident most recently.
*/
public String getLastModifiedBy() {
return this.lastModifiedBy;
}
/**
*
* Who modified the incident most recently.
*
*
* @param lastModifiedBy
* Who modified the incident most recently.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withLastModifiedBy(String lastModifiedBy) {
setLastModifiedBy(lastModifiedBy);
return this;
}
/**
*
* The timestamp for when the incident was most recently modified.
*
*
* @param lastModifiedTime
* The timestamp for when the incident was most recently modified.
*/
public void setLastModifiedTime(java.util.Date lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
/**
*
* The timestamp for when the incident was most recently modified.
*
*
* @return The timestamp for when the incident was most recently modified.
*/
public java.util.Date getLastModifiedTime() {
return this.lastModifiedTime;
}
/**
*
* The timestamp for when the incident was most recently modified.
*
*
* @param lastModifiedTime
* The timestamp for when the incident was most recently modified.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withLastModifiedTime(java.util.Date lastModifiedTime) {
setLastModifiedTime(lastModifiedTime);
return this;
}
/**
*
* The Amazon SNS targets that are notified when updates are made to an incident.
*
*
* @return The Amazon SNS targets that are notified when updates are made to an incident.
*/
public java.util.List getNotificationTargets() {
return notificationTargets;
}
/**
*
* The Amazon SNS targets that are notified when updates are made to an incident.
*
*
* @param notificationTargets
* The Amazon SNS targets that are notified when updates are made to an incident.
*/
public void setNotificationTargets(java.util.Collection notificationTargets) {
if (notificationTargets == null) {
this.notificationTargets = null;
return;
}
this.notificationTargets = new java.util.ArrayList(notificationTargets);
}
/**
*
* The Amazon SNS targets that are notified when updates are made to an incident.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setNotificationTargets(java.util.Collection)} or {@link #withNotificationTargets(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param notificationTargets
* The Amazon SNS targets that are notified when updates are made to an incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withNotificationTargets(NotificationTargetItem... notificationTargets) {
if (this.notificationTargets == null) {
setNotificationTargets(new java.util.ArrayList(notificationTargets.length));
}
for (NotificationTargetItem ele : notificationTargets) {
this.notificationTargets.add(ele);
}
return this;
}
/**
*
* The Amazon SNS targets that are notified when updates are made to an incident.
*
*
* @param notificationTargets
* The Amazon SNS targets that are notified when updates are made to an incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withNotificationTargets(java.util.Collection notificationTargets) {
setNotificationTargets(notificationTargets);
return this;
}
/**
*
* The timestamp for when the incident was resolved. This appears as a timeline event.
*
*
* @param resolvedTime
* The timestamp for when the incident was resolved. This appears as a timeline event.
*/
public void setResolvedTime(java.util.Date resolvedTime) {
this.resolvedTime = resolvedTime;
}
/**
*
* The timestamp for when the incident was resolved. This appears as a timeline event.
*
*
* @return The timestamp for when the incident was resolved. This appears as a timeline event.
*/
public java.util.Date getResolvedTime() {
return this.resolvedTime;
}
/**
*
* The timestamp for when the incident was resolved. This appears as a timeline event.
*
*
* @param resolvedTime
* The timestamp for when the incident was resolved. This appears as a timeline event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withResolvedTime(java.util.Date resolvedTime) {
setResolvedTime(resolvedTime);
return this;
}
/**
*
* The current status of the incident.
*
*
* @param status
* The current status of the incident.
* @see IncidentRecordStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The current status of the incident.
*
*
* @return The current status of the incident.
* @see IncidentRecordStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The current status of the incident.
*
*
* @param status
* The current status of the incident.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IncidentRecordStatus
*/
public IncidentRecord withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The current status of the incident.
*
*
* @param status
* The current status of the incident.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IncidentRecordStatus
*/
public IncidentRecord withStatus(IncidentRecordStatus status) {
this.status = status.toString();
return this;
}
/**
*
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening, and
* context of the incident.
*
*
* @param summary
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening,
* and context of the incident.
*/
public void setSummary(String summary) {
this.summary = summary;
}
/**
*
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening, and
* context of the incident.
*
*
* @return The summary of the incident. The summary is a brief synopsis of what occurred, what's currently
* happening, and context of the incident.
*/
public String getSummary() {
return this.summary;
}
/**
*
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening, and
* context of the incident.
*
*
* @param summary
* The summary of the incident. The summary is a brief synopsis of what occurred, what's currently happening,
* and context of the incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withSummary(String summary) {
setSummary(summary);
return this;
}
/**
*
* The title of the incident.
*
*
* @param title
* The title of the incident.
*/
public void setTitle(String title) {
this.title = title;
}
/**
*
* The title of the incident.
*
*
* @return The title of the incident.
*/
public String getTitle() {
return this.title;
}
/**
*
* The title of the incident.
*
*
* @param title
* The title of the incident.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IncidentRecord withTitle(String title) {
setTitle(title);
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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getAutomationExecutions() != null)
sb.append("AutomationExecutions: ").append(getAutomationExecutions()).append(",");
if (getChatChannel() != null)
sb.append("ChatChannel: ").append(getChatChannel()).append(",");
if (getCreationTime() != null)
sb.append("CreationTime: ").append(getCreationTime()).append(",");
if (getDedupeString() != null)
sb.append("DedupeString: ").append(getDedupeString()).append(",");
if (getImpact() != null)
sb.append("Impact: ").append(getImpact()).append(",");
if (getIncidentRecordSource() != null)
sb.append("IncidentRecordSource: ").append(getIncidentRecordSource()).append(",");
if (getLastModifiedBy() != null)
sb.append("LastModifiedBy: ").append(getLastModifiedBy()).append(",");
if (getLastModifiedTime() != null)
sb.append("LastModifiedTime: ").append(getLastModifiedTime()).append(",");
if (getNotificationTargets() != null)
sb.append("NotificationTargets: ").append(getNotificationTargets()).append(",");
if (getResolvedTime() != null)
sb.append("ResolvedTime: ").append(getResolvedTime()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getSummary() != null)
sb.append("Summary: ").append(getSummary()).append(",");
if (getTitle() != null)
sb.append("Title: ").append(getTitle());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof IncidentRecord == false)
return false;
IncidentRecord other = (IncidentRecord) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getAutomationExecutions() == null ^ this.getAutomationExecutions() == null)
return false;
if (other.getAutomationExecutions() != null && other.getAutomationExecutions().equals(this.getAutomationExecutions()) == false)
return false;
if (other.getChatChannel() == null ^ this.getChatChannel() == null)
return false;
if (other.getChatChannel() != null && other.getChatChannel().equals(this.getChatChannel()) == false)
return false;
if (other.getCreationTime() == null ^ this.getCreationTime() == null)
return false;
if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
return false;
if (other.getDedupeString() == null ^ this.getDedupeString() == null)
return false;
if (other.getDedupeString() != null && other.getDedupeString().equals(this.getDedupeString()) == false)
return false;
if (other.getImpact() == null ^ this.getImpact() == null)
return false;
if (other.getImpact() != null && other.getImpact().equals(this.getImpact()) == false)
return false;
if (other.getIncidentRecordSource() == null ^ this.getIncidentRecordSource() == null)
return false;
if (other.getIncidentRecordSource() != null && other.getIncidentRecordSource().equals(this.getIncidentRecordSource()) == false)
return false;
if (other.getLastModifiedBy() == null ^ this.getLastModifiedBy() == null)
return false;
if (other.getLastModifiedBy() != null && other.getLastModifiedBy().equals(this.getLastModifiedBy()) == false)
return false;
if (other.getLastModifiedTime() == null ^ this.getLastModifiedTime() == null)
return false;
if (other.getLastModifiedTime() != null && other.getLastModifiedTime().equals(this.getLastModifiedTime()) == false)
return false;
if (other.getNotificationTargets() == null ^ this.getNotificationTargets() == null)
return false;
if (other.getNotificationTargets() != null && other.getNotificationTargets().equals(this.getNotificationTargets()) == false)
return false;
if (other.getResolvedTime() == null ^ this.getResolvedTime() == null)
return false;
if (other.getResolvedTime() != null && other.getResolvedTime().equals(this.getResolvedTime()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getSummary() == null ^ this.getSummary() == null)
return false;
if (other.getSummary() != null && other.getSummary().equals(this.getSummary()) == false)
return false;
if (other.getTitle() == null ^ this.getTitle() == null)
return false;
if (other.getTitle() != null && other.getTitle().equals(this.getTitle()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getAutomationExecutions() == null) ? 0 : getAutomationExecutions().hashCode());
hashCode = prime * hashCode + ((getChatChannel() == null) ? 0 : getChatChannel().hashCode());
hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
hashCode = prime * hashCode + ((getDedupeString() == null) ? 0 : getDedupeString().hashCode());
hashCode = prime * hashCode + ((getImpact() == null) ? 0 : getImpact().hashCode());
hashCode = prime * hashCode + ((getIncidentRecordSource() == null) ? 0 : getIncidentRecordSource().hashCode());
hashCode = prime * hashCode + ((getLastModifiedBy() == null) ? 0 : getLastModifiedBy().hashCode());
hashCode = prime * hashCode + ((getLastModifiedTime() == null) ? 0 : getLastModifiedTime().hashCode());
hashCode = prime * hashCode + ((getNotificationTargets() == null) ? 0 : getNotificationTargets().hashCode());
hashCode = prime * hashCode + ((getResolvedTime() == null) ? 0 : getResolvedTime().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getSummary() == null) ? 0 : getSummary().hashCode());
hashCode = prime * hashCode + ((getTitle() == null) ? 0 : getTitle().hashCode());
return hashCode;
}
@Override
public IncidentRecord clone() {
try {
return (IncidentRecord) 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.ssmincidents.model.transform.IncidentRecordMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}