com.amazonaws.services.resiliencehub.model.EventSubscription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-resiliencehub 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.resiliencehub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Indicates an event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected and Scheduled assessment failure events.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EventSubscription implements Serializable, Cloneable, StructuredPojo {
/**
*
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment failure
* (ScheduledAssessmentFailure
) events.
*
*/
private String eventType;
/**
*
* Unique name to identify an event subscription.
*
*/
private String name;
/**
*
* Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
*
*/
private String snsTopicArn;
/**
*
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment failure
* (ScheduledAssessmentFailure
) events.
*
*
* @param eventType
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment
* failure (ScheduledAssessmentFailure
) events.
* @see EventType
*/
public void setEventType(String eventType) {
this.eventType = eventType;
}
/**
*
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment failure
* (ScheduledAssessmentFailure
) events.
*
*
* @return The type of event you would like to subscribe and get notification for. Currently, Resilience Hub
* supports notifications only for Drift detected (DriftDetected
) and Scheduled
* assessment failure (ScheduledAssessmentFailure
) events.
* @see EventType
*/
public String getEventType() {
return this.eventType;
}
/**
*
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment failure
* (ScheduledAssessmentFailure
) events.
*
*
* @param eventType
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment
* failure (ScheduledAssessmentFailure
) events.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventType
*/
public EventSubscription withEventType(String eventType) {
setEventType(eventType);
return this;
}
/**
*
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment failure
* (ScheduledAssessmentFailure
) events.
*
*
* @param eventType
* The type of event you would like to subscribe and get notification for. Currently, Resilience Hub supports
* notifications only for Drift detected (DriftDetected
) and Scheduled assessment
* failure (ScheduledAssessmentFailure
) events.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventType
*/
public EventSubscription withEventType(EventType eventType) {
this.eventType = eventType.toString();
return this;
}
/**
*
* Unique name to identify an event subscription.
*
*
* @param name
* Unique name to identify an event subscription.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* Unique name to identify an event subscription.
*
*
* @return Unique name to identify an event subscription.
*/
public String getName() {
return this.name;
}
/**
*
* Unique name to identify an event subscription.
*
*
* @param name
* Unique name to identify an event subscription.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSubscription withName(String name) {
setName(name);
return this;
}
/**
*
* Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
*
*
* @param snsTopicArn
* Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
*/
public void setSnsTopicArn(String snsTopicArn) {
this.snsTopicArn = snsTopicArn;
}
/**
*
* Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
*
*
* @return Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
*/
public String getSnsTopicArn() {
return this.snsTopicArn;
}
/**
*
* Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
*
*
* @param snsTopicArn
* Amazon Resource Name (ARN) of the Amazon Simple Notification Service topic. The format for this ARN is:
* arn:partition:sns:region:account:topic-name
. For more information about ARNs, see Amazon Resource Names
* (ARNs) in the Amazon Web Services General Reference guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSubscription withSnsTopicArn(String snsTopicArn) {
setSnsTopicArn(snsTopicArn);
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 (getEventType() != null)
sb.append("EventType: ").append(getEventType()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getSnsTopicArn() != null)
sb.append("SnsTopicArn: ").append(getSnsTopicArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EventSubscription == false)
return false;
EventSubscription other = (EventSubscription) obj;
if (other.getEventType() == null ^ this.getEventType() == null)
return false;
if (other.getEventType() != null && other.getEventType().equals(this.getEventType()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getSnsTopicArn() == null ^ this.getSnsTopicArn() == null)
return false;
if (other.getSnsTopicArn() != null && other.getSnsTopicArn().equals(this.getSnsTopicArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEventType() == null) ? 0 : getEventType().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getSnsTopicArn() == null) ? 0 : getSnsTopicArn().hashCode());
return hashCode;
}
@Override
public EventSubscription clone() {
try {
return (EventSubscription) 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.resiliencehub.model.transform.EventSubscriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}