com.amazonaws.services.snowball.model.Notification Maven / Gradle / Ivy
Show all versions of aws-java-sdk-snowball 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.snowball.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The Amazon Simple Notification Service (Amazon SNS) notification settings associated with a specific job. The
* Notification
object is returned as a part of the response syntax of the DescribeJob
action
* in the JobMetadata
data type.
*
*
* When the notification settings are defined during job creation, you can choose to notify based on a specific set of
* job states using the JobStatesToNotify
array of strings, or you can specify that you want to have Amazon
* SNS notifications sent out for all job states with NotifyAll
set to true.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Notification implements Serializable, Cloneable, StructuredPojo {
/**
*
* The new SNS TopicArn
that you want to associate with this job. You can create Amazon Resource Names
* (ARNs) for topics by using the CreateTopic Amazon SNS API action.
*
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or
* by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
*
*/
private String snsTopicARN;
/**
*
* The list of job states that will trigger a notification for this job.
*
*/
private java.util.List jobStatesToNotify;
/**
*
* Any change in job state will trigger a notification for this job.
*
*/
private Boolean notifyAll;
/**
*
* Used to send SNS notifications for the person picking up the device (identified during job creation).
*
*/
private String devicePickupSnsTopicARN;
/**
*
* The new SNS TopicArn
that you want to associate with this job. You can create Amazon Resource Names
* (ARNs) for topics by using the CreateTopic Amazon SNS API action.
*
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or
* by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
*
*
* @param snsTopicARN
* The new SNS TopicArn
that you want to associate with this job. You can create Amazon Resource
* Names (ARNs) for topics by using the CreateTopic Amazon SNS API
* action.
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management
* Console, or by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
*/
public void setSnsTopicARN(String snsTopicARN) {
this.snsTopicARN = snsTopicARN;
}
/**
*
* The new SNS TopicArn
that you want to associate with this job. You can create Amazon Resource Names
* (ARNs) for topics by using the CreateTopic Amazon SNS API action.
*
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or
* by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
*
*
* @return The new SNS TopicArn
that you want to associate with this job. You can create Amazon
* Resource Names (ARNs) for topics by using the CreateTopic Amazon SNS API
* action.
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management
* Console, or by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
*/
public String getSnsTopicARN() {
return this.snsTopicARN;
}
/**
*
* The new SNS TopicArn
that you want to associate with this job. You can create Amazon Resource Names
* (ARNs) for topics by using the CreateTopic Amazon SNS API action.
*
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management Console, or
* by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
*
*
* @param snsTopicARN
* The new SNS TopicArn
that you want to associate with this job. You can create Amazon Resource
* Names (ARNs) for topics by using the CreateTopic Amazon SNS API
* action.
*
* You can subscribe email addresses to an Amazon SNS topic through the Amazon Web Services Management
* Console, or by using the Subscribe Amazon Simple
* Notification Service (Amazon SNS) API action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Notification withSnsTopicARN(String snsTopicARN) {
setSnsTopicARN(snsTopicARN);
return this;
}
/**
*
* The list of job states that will trigger a notification for this job.
*
*
* @return The list of job states that will trigger a notification for this job.
* @see JobState
*/
public java.util.List getJobStatesToNotify() {
return jobStatesToNotify;
}
/**
*
* The list of job states that will trigger a notification for this job.
*
*
* @param jobStatesToNotify
* The list of job states that will trigger a notification for this job.
* @see JobState
*/
public void setJobStatesToNotify(java.util.Collection jobStatesToNotify) {
if (jobStatesToNotify == null) {
this.jobStatesToNotify = null;
return;
}
this.jobStatesToNotify = new java.util.ArrayList(jobStatesToNotify);
}
/**
*
* The list of job states that will trigger a notification for this job.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setJobStatesToNotify(java.util.Collection)} or {@link #withJobStatesToNotify(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param jobStatesToNotify
* The list of job states that will trigger a notification for this job.
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobState
*/
public Notification withJobStatesToNotify(String... jobStatesToNotify) {
if (this.jobStatesToNotify == null) {
setJobStatesToNotify(new java.util.ArrayList(jobStatesToNotify.length));
}
for (String ele : jobStatesToNotify) {
this.jobStatesToNotify.add(ele);
}
return this;
}
/**
*
* The list of job states that will trigger a notification for this job.
*
*
* @param jobStatesToNotify
* The list of job states that will trigger a notification for this job.
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobState
*/
public Notification withJobStatesToNotify(java.util.Collection jobStatesToNotify) {
setJobStatesToNotify(jobStatesToNotify);
return this;
}
/**
*
* The list of job states that will trigger a notification for this job.
*
*
* @param jobStatesToNotify
* The list of job states that will trigger a notification for this job.
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobState
*/
public Notification withJobStatesToNotify(JobState... jobStatesToNotify) {
java.util.ArrayList jobStatesToNotifyCopy = new java.util.ArrayList(jobStatesToNotify.length);
for (JobState value : jobStatesToNotify) {
jobStatesToNotifyCopy.add(value.toString());
}
if (getJobStatesToNotify() == null) {
setJobStatesToNotify(jobStatesToNotifyCopy);
} else {
getJobStatesToNotify().addAll(jobStatesToNotifyCopy);
}
return this;
}
/**
*
* Any change in job state will trigger a notification for this job.
*
*
* @param notifyAll
* Any change in job state will trigger a notification for this job.
*/
public void setNotifyAll(Boolean notifyAll) {
this.notifyAll = notifyAll;
}
/**
*
* Any change in job state will trigger a notification for this job.
*
*
* @return Any change in job state will trigger a notification for this job.
*/
public Boolean getNotifyAll() {
return this.notifyAll;
}
/**
*
* Any change in job state will trigger a notification for this job.
*
*
* @param notifyAll
* Any change in job state will trigger a notification for this job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Notification withNotifyAll(Boolean notifyAll) {
setNotifyAll(notifyAll);
return this;
}
/**
*
* Any change in job state will trigger a notification for this job.
*
*
* @return Any change in job state will trigger a notification for this job.
*/
public Boolean isNotifyAll() {
return this.notifyAll;
}
/**
*
* Used to send SNS notifications for the person picking up the device (identified during job creation).
*
*
* @param devicePickupSnsTopicARN
* Used to send SNS notifications for the person picking up the device (identified during job creation).
*/
public void setDevicePickupSnsTopicARN(String devicePickupSnsTopicARN) {
this.devicePickupSnsTopicARN = devicePickupSnsTopicARN;
}
/**
*
* Used to send SNS notifications for the person picking up the device (identified during job creation).
*
*
* @return Used to send SNS notifications for the person picking up the device (identified during job creation).
*/
public String getDevicePickupSnsTopicARN() {
return this.devicePickupSnsTopicARN;
}
/**
*
* Used to send SNS notifications for the person picking up the device (identified during job creation).
*
*
* @param devicePickupSnsTopicARN
* Used to send SNS notifications for the person picking up the device (identified during job creation).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Notification withDevicePickupSnsTopicARN(String devicePickupSnsTopicARN) {
setDevicePickupSnsTopicARN(devicePickupSnsTopicARN);
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 (getSnsTopicARN() != null)
sb.append("SnsTopicARN: ").append(getSnsTopicARN()).append(",");
if (getJobStatesToNotify() != null)
sb.append("JobStatesToNotify: ").append(getJobStatesToNotify()).append(",");
if (getNotifyAll() != null)
sb.append("NotifyAll: ").append(getNotifyAll()).append(",");
if (getDevicePickupSnsTopicARN() != null)
sb.append("DevicePickupSnsTopicARN: ").append(getDevicePickupSnsTopicARN());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Notification == false)
return false;
Notification other = (Notification) obj;
if (other.getSnsTopicARN() == null ^ this.getSnsTopicARN() == null)
return false;
if (other.getSnsTopicARN() != null && other.getSnsTopicARN().equals(this.getSnsTopicARN()) == false)
return false;
if (other.getJobStatesToNotify() == null ^ this.getJobStatesToNotify() == null)
return false;
if (other.getJobStatesToNotify() != null && other.getJobStatesToNotify().equals(this.getJobStatesToNotify()) == false)
return false;
if (other.getNotifyAll() == null ^ this.getNotifyAll() == null)
return false;
if (other.getNotifyAll() != null && other.getNotifyAll().equals(this.getNotifyAll()) == false)
return false;
if (other.getDevicePickupSnsTopicARN() == null ^ this.getDevicePickupSnsTopicARN() == null)
return false;
if (other.getDevicePickupSnsTopicARN() != null && other.getDevicePickupSnsTopicARN().equals(this.getDevicePickupSnsTopicARN()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSnsTopicARN() == null) ? 0 : getSnsTopicARN().hashCode());
hashCode = prime * hashCode + ((getJobStatesToNotify() == null) ? 0 : getJobStatesToNotify().hashCode());
hashCode = prime * hashCode + ((getNotifyAll() == null) ? 0 : getNotifyAll().hashCode());
hashCode = prime * hashCode + ((getDevicePickupSnsTopicARN() == null) ? 0 : getDevicePickupSnsTopicARN().hashCode());
return hashCode;
}
@Override
public Notification clone() {
try {
return (Notification) 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.snowball.model.transform.NotificationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}