com.amazonaws.services.mediatailor.model.Alert Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mediatailor 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.mediatailor.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Alert configuration parameters.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Alert implements Serializable, Cloneable, StructuredPojo {
/**
*
* The code for the alert. For example, NOT_PROCESSED
.
*
*/
private String alertCode;
/**
*
* If an alert is generated for a resource, an explanation of the reason for the alert.
*
*/
private String alertMessage;
/**
*
* The category that MediaTailor assigns to the alert.
*
*/
private String category;
/**
*
* The timestamp when the alert was last modified.
*
*/
private java.util.Date lastModifiedTime;
/**
*
* The Amazon Resource Names (ARNs) related to this alert.
*
*/
private java.util.List relatedResourceArns;
/**
*
* The Amazon Resource Name (ARN) of the resource.
*
*/
private String resourceArn;
/**
*
* The code for the alert. For example, NOT_PROCESSED
.
*
*
* @param alertCode
* The code for the alert. For example, NOT_PROCESSED
.
*/
public void setAlertCode(String alertCode) {
this.alertCode = alertCode;
}
/**
*
* The code for the alert. For example, NOT_PROCESSED
.
*
*
* @return The code for the alert. For example, NOT_PROCESSED
.
*/
public String getAlertCode() {
return this.alertCode;
}
/**
*
* The code for the alert. For example, NOT_PROCESSED
.
*
*
* @param alertCode
* The code for the alert. For example, NOT_PROCESSED
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Alert withAlertCode(String alertCode) {
setAlertCode(alertCode);
return this;
}
/**
*
* If an alert is generated for a resource, an explanation of the reason for the alert.
*
*
* @param alertMessage
* If an alert is generated for a resource, an explanation of the reason for the alert.
*/
public void setAlertMessage(String alertMessage) {
this.alertMessage = alertMessage;
}
/**
*
* If an alert is generated for a resource, an explanation of the reason for the alert.
*
*
* @return If an alert is generated for a resource, an explanation of the reason for the alert.
*/
public String getAlertMessage() {
return this.alertMessage;
}
/**
*
* If an alert is generated for a resource, an explanation of the reason for the alert.
*
*
* @param alertMessage
* If an alert is generated for a resource, an explanation of the reason for the alert.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Alert withAlertMessage(String alertMessage) {
setAlertMessage(alertMessage);
return this;
}
/**
*
* The category that MediaTailor assigns to the alert.
*
*
* @param category
* The category that MediaTailor assigns to the alert.
* @see AlertCategory
*/
public void setCategory(String category) {
this.category = category;
}
/**
*
* The category that MediaTailor assigns to the alert.
*
*
* @return The category that MediaTailor assigns to the alert.
* @see AlertCategory
*/
public String getCategory() {
return this.category;
}
/**
*
* The category that MediaTailor assigns to the alert.
*
*
* @param category
* The category that MediaTailor assigns to the alert.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AlertCategory
*/
public Alert withCategory(String category) {
setCategory(category);
return this;
}
/**
*
* The category that MediaTailor assigns to the alert.
*
*
* @param category
* The category that MediaTailor assigns to the alert.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AlertCategory
*/
public Alert withCategory(AlertCategory category) {
this.category = category.toString();
return this;
}
/**
*
* The timestamp when the alert was last modified.
*
*
* @param lastModifiedTime
* The timestamp when the alert was last modified.
*/
public void setLastModifiedTime(java.util.Date lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
/**
*
* The timestamp when the alert was last modified.
*
*
* @return The timestamp when the alert was last modified.
*/
public java.util.Date getLastModifiedTime() {
return this.lastModifiedTime;
}
/**
*
* The timestamp when the alert was last modified.
*
*
* @param lastModifiedTime
* The timestamp when the alert was last modified.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Alert withLastModifiedTime(java.util.Date lastModifiedTime) {
setLastModifiedTime(lastModifiedTime);
return this;
}
/**
*
* The Amazon Resource Names (ARNs) related to this alert.
*
*
* @return The Amazon Resource Names (ARNs) related to this alert.
*/
public java.util.List getRelatedResourceArns() {
return relatedResourceArns;
}
/**
*
* The Amazon Resource Names (ARNs) related to this alert.
*
*
* @param relatedResourceArns
* The Amazon Resource Names (ARNs) related to this alert.
*/
public void setRelatedResourceArns(java.util.Collection relatedResourceArns) {
if (relatedResourceArns == null) {
this.relatedResourceArns = null;
return;
}
this.relatedResourceArns = new java.util.ArrayList(relatedResourceArns);
}
/**
*
* The Amazon Resource Names (ARNs) related to this alert.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRelatedResourceArns(java.util.Collection)} or {@link #withRelatedResourceArns(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param relatedResourceArns
* The Amazon Resource Names (ARNs) related to this alert.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Alert withRelatedResourceArns(String... relatedResourceArns) {
if (this.relatedResourceArns == null) {
setRelatedResourceArns(new java.util.ArrayList(relatedResourceArns.length));
}
for (String ele : relatedResourceArns) {
this.relatedResourceArns.add(ele);
}
return this;
}
/**
*
* The Amazon Resource Names (ARNs) related to this alert.
*
*
* @param relatedResourceArns
* The Amazon Resource Names (ARNs) related to this alert.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Alert withRelatedResourceArns(java.util.Collection relatedResourceArns) {
setRelatedResourceArns(relatedResourceArns);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the resource.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the resource.
*/
public void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the resource.
*
*
* @return The Amazon Resource Name (ARN) of the resource.
*/
public String getResourceArn() {
return this.resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the resource.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Alert withResourceArn(String resourceArn) {
setResourceArn(resourceArn);
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 (getAlertCode() != null)
sb.append("AlertCode: ").append(getAlertCode()).append(",");
if (getAlertMessage() != null)
sb.append("AlertMessage: ").append(getAlertMessage()).append(",");
if (getCategory() != null)
sb.append("Category: ").append(getCategory()).append(",");
if (getLastModifiedTime() != null)
sb.append("LastModifiedTime: ").append(getLastModifiedTime()).append(",");
if (getRelatedResourceArns() != null)
sb.append("RelatedResourceArns: ").append(getRelatedResourceArns()).append(",");
if (getResourceArn() != null)
sb.append("ResourceArn: ").append(getResourceArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Alert == false)
return false;
Alert other = (Alert) obj;
if (other.getAlertCode() == null ^ this.getAlertCode() == null)
return false;
if (other.getAlertCode() != null && other.getAlertCode().equals(this.getAlertCode()) == false)
return false;
if (other.getAlertMessage() == null ^ this.getAlertMessage() == null)
return false;
if (other.getAlertMessage() != null && other.getAlertMessage().equals(this.getAlertMessage()) == false)
return false;
if (other.getCategory() == null ^ this.getCategory() == null)
return false;
if (other.getCategory() != null && other.getCategory().equals(this.getCategory()) == 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.getRelatedResourceArns() == null ^ this.getRelatedResourceArns() == null)
return false;
if (other.getRelatedResourceArns() != null && other.getRelatedResourceArns().equals(this.getRelatedResourceArns()) == false)
return false;
if (other.getResourceArn() == null ^ this.getResourceArn() == null)
return false;
if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAlertCode() == null) ? 0 : getAlertCode().hashCode());
hashCode = prime * hashCode + ((getAlertMessage() == null) ? 0 : getAlertMessage().hashCode());
hashCode = prime * hashCode + ((getCategory() == null) ? 0 : getCategory().hashCode());
hashCode = prime * hashCode + ((getLastModifiedTime() == null) ? 0 : getLastModifiedTime().hashCode());
hashCode = prime * hashCode + ((getRelatedResourceArns() == null) ? 0 : getRelatedResourceArns().hashCode());
hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode());
return hashCode;
}
@Override
public Alert clone() {
try {
return (Alert) 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.mediatailor.model.transform.AlertMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}