com.amazonaws.services.directory.model.EventTopic Maven / Gradle / Ivy
Show all versions of aws-java-sdk-directory 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.directory.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about Amazon SNS topic and Directory Service directory associations.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EventTopic implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS topic.
*
*/
private String directoryId;
/**
*
* The name of an Amazon SNS topic the receives status messages from the directory.
*
*/
private String topicName;
/**
*
* The Amazon SNS topic ARN (Amazon Resource Name).
*
*/
private String topicArn;
/**
*
* The date and time of when you associated your directory with the Amazon SNS topic.
*
*/
private java.util.Date createdDateTime;
/**
*
* The topic registration status.
*
*/
private String status;
/**
*
* The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS topic.
*
*
* @param directoryId
* The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS
* topic.
*/
public void setDirectoryId(String directoryId) {
this.directoryId = directoryId;
}
/**
*
* The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS topic.
*
*
* @return The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS
* topic.
*/
public String getDirectoryId() {
return this.directoryId;
}
/**
*
* The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS topic.
*
*
* @param directoryId
* The Directory ID of an Directory Service directory that will publish status messages to an Amazon SNS
* topic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventTopic withDirectoryId(String directoryId) {
setDirectoryId(directoryId);
return this;
}
/**
*
* The name of an Amazon SNS topic the receives status messages from the directory.
*
*
* @param topicName
* The name of an Amazon SNS topic the receives status messages from the directory.
*/
public void setTopicName(String topicName) {
this.topicName = topicName;
}
/**
*
* The name of an Amazon SNS topic the receives status messages from the directory.
*
*
* @return The name of an Amazon SNS topic the receives status messages from the directory.
*/
public String getTopicName() {
return this.topicName;
}
/**
*
* The name of an Amazon SNS topic the receives status messages from the directory.
*
*
* @param topicName
* The name of an Amazon SNS topic the receives status messages from the directory.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventTopic withTopicName(String topicName) {
setTopicName(topicName);
return this;
}
/**
*
* The Amazon SNS topic ARN (Amazon Resource Name).
*
*
* @param topicArn
* The Amazon SNS topic ARN (Amazon Resource Name).
*/
public void setTopicArn(String topicArn) {
this.topicArn = topicArn;
}
/**
*
* The Amazon SNS topic ARN (Amazon Resource Name).
*
*
* @return The Amazon SNS topic ARN (Amazon Resource Name).
*/
public String getTopicArn() {
return this.topicArn;
}
/**
*
* The Amazon SNS topic ARN (Amazon Resource Name).
*
*
* @param topicArn
* The Amazon SNS topic ARN (Amazon Resource Name).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventTopic withTopicArn(String topicArn) {
setTopicArn(topicArn);
return this;
}
/**
*
* The date and time of when you associated your directory with the Amazon SNS topic.
*
*
* @param createdDateTime
* The date and time of when you associated your directory with the Amazon SNS topic.
*/
public void setCreatedDateTime(java.util.Date createdDateTime) {
this.createdDateTime = createdDateTime;
}
/**
*
* The date and time of when you associated your directory with the Amazon SNS topic.
*
*
* @return The date and time of when you associated your directory with the Amazon SNS topic.
*/
public java.util.Date getCreatedDateTime() {
return this.createdDateTime;
}
/**
*
* The date and time of when you associated your directory with the Amazon SNS topic.
*
*
* @param createdDateTime
* The date and time of when you associated your directory with the Amazon SNS topic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventTopic withCreatedDateTime(java.util.Date createdDateTime) {
setCreatedDateTime(createdDateTime);
return this;
}
/**
*
* The topic registration status.
*
*
* @param status
* The topic registration status.
* @see TopicStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The topic registration status.
*
*
* @return The topic registration status.
* @see TopicStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The topic registration status.
*
*
* @param status
* The topic registration status.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TopicStatus
*/
public EventTopic withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The topic registration status.
*
*
* @param status
* The topic registration status.
* @see TopicStatus
*/
public void setStatus(TopicStatus status) {
withStatus(status);
}
/**
*
* The topic registration status.
*
*
* @param status
* The topic registration status.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TopicStatus
*/
public EventTopic withStatus(TopicStatus status) {
this.status = status.toString();
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 (getDirectoryId() != null)
sb.append("DirectoryId: ").append(getDirectoryId()).append(",");
if (getTopicName() != null)
sb.append("TopicName: ").append(getTopicName()).append(",");
if (getTopicArn() != null)
sb.append("TopicArn: ").append(getTopicArn()).append(",");
if (getCreatedDateTime() != null)
sb.append("CreatedDateTime: ").append(getCreatedDateTime()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EventTopic == false)
return false;
EventTopic other = (EventTopic) obj;
if (other.getDirectoryId() == null ^ this.getDirectoryId() == null)
return false;
if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == false)
return false;
if (other.getTopicName() == null ^ this.getTopicName() == null)
return false;
if (other.getTopicName() != null && other.getTopicName().equals(this.getTopicName()) == false)
return false;
if (other.getTopicArn() == null ^ this.getTopicArn() == null)
return false;
if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == false)
return false;
if (other.getCreatedDateTime() == null ^ this.getCreatedDateTime() == null)
return false;
if (other.getCreatedDateTime() != null && other.getCreatedDateTime().equals(this.getCreatedDateTime()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode());
hashCode = prime * hashCode + ((getTopicName() == null) ? 0 : getTopicName().hashCode());
hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode());
hashCode = prime * hashCode + ((getCreatedDateTime() == null) ? 0 : getCreatedDateTime().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public EventTopic clone() {
try {
return (EventTopic) 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.directory.model.transform.EventTopicMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}