com.amazonaws.services.codeguruprofiler.model.Channel Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codeguruprofiler 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.codeguruprofiler.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Notification medium for users to get alerted for events that occur in application profile. We support SNS topic as a
* notification channel.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Channel implements Serializable, Cloneable, StructuredPojo {
/**
*
* List of publishers for different type of events that may be detected in an application from the profile. Anomaly
* detection is the only event publisher in Profiler.
*
*/
private java.util.List eventPublishers;
/**
*
* Unique identifier for each Channel
in the notification configuration of a Profiling Group. A random
* UUID for channelId is used when adding a channel to the notification configuration if not specified in the
* request.
*
*/
private String id;
/**
*
* Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.
*
*/
private String uri;
/**
*
* List of publishers for different type of events that may be detected in an application from the profile. Anomaly
* detection is the only event publisher in Profiler.
*
*
* @return List of publishers for different type of events that may be detected in an application from the profile.
* Anomaly detection is the only event publisher in Profiler.
* @see EventPublisher
*/
public java.util.List getEventPublishers() {
return eventPublishers;
}
/**
*
* List of publishers for different type of events that may be detected in an application from the profile. Anomaly
* detection is the only event publisher in Profiler.
*
*
* @param eventPublishers
* List of publishers for different type of events that may be detected in an application from the profile.
* Anomaly detection is the only event publisher in Profiler.
* @see EventPublisher
*/
public void setEventPublishers(java.util.Collection eventPublishers) {
if (eventPublishers == null) {
this.eventPublishers = null;
return;
}
this.eventPublishers = new java.util.ArrayList(eventPublishers);
}
/**
*
* List of publishers for different type of events that may be detected in an application from the profile. Anomaly
* detection is the only event publisher in Profiler.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEventPublishers(java.util.Collection)} or {@link #withEventPublishers(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param eventPublishers
* List of publishers for different type of events that may be detected in an application from the profile.
* Anomaly detection is the only event publisher in Profiler.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventPublisher
*/
public Channel withEventPublishers(String... eventPublishers) {
if (this.eventPublishers == null) {
setEventPublishers(new java.util.ArrayList(eventPublishers.length));
}
for (String ele : eventPublishers) {
this.eventPublishers.add(ele);
}
return this;
}
/**
*
* List of publishers for different type of events that may be detected in an application from the profile. Anomaly
* detection is the only event publisher in Profiler.
*
*
* @param eventPublishers
* List of publishers for different type of events that may be detected in an application from the profile.
* Anomaly detection is the only event publisher in Profiler.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventPublisher
*/
public Channel withEventPublishers(java.util.Collection eventPublishers) {
setEventPublishers(eventPublishers);
return this;
}
/**
*
* List of publishers for different type of events that may be detected in an application from the profile. Anomaly
* detection is the only event publisher in Profiler.
*
*
* @param eventPublishers
* List of publishers for different type of events that may be detected in an application from the profile.
* Anomaly detection is the only event publisher in Profiler.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventPublisher
*/
public Channel withEventPublishers(EventPublisher... eventPublishers) {
java.util.ArrayList eventPublishersCopy = new java.util.ArrayList(eventPublishers.length);
for (EventPublisher value : eventPublishers) {
eventPublishersCopy.add(value.toString());
}
if (getEventPublishers() == null) {
setEventPublishers(eventPublishersCopy);
} else {
getEventPublishers().addAll(eventPublishersCopy);
}
return this;
}
/**
*
* Unique identifier for each Channel
in the notification configuration of a Profiling Group. A random
* UUID for channelId is used when adding a channel to the notification configuration if not specified in the
* request.
*
*
* @param id
* Unique identifier for each Channel
in the notification configuration of a Profiling Group. A
* random UUID for channelId is used when adding a channel to the notification configuration if not specified
* in the request.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* Unique identifier for each Channel
in the notification configuration of a Profiling Group. A random
* UUID for channelId is used when adding a channel to the notification configuration if not specified in the
* request.
*
*
* @return Unique identifier for each Channel
in the notification configuration of a Profiling Group. A
* random UUID for channelId is used when adding a channel to the notification configuration if not
* specified in the request.
*/
public String getId() {
return this.id;
}
/**
*
* Unique identifier for each Channel
in the notification configuration of a Profiling Group. A random
* UUID for channelId is used when adding a channel to the notification configuration if not specified in the
* request.
*
*
* @param id
* Unique identifier for each Channel
in the notification configuration of a Profiling Group. A
* random UUID for channelId is used when adding a channel to the notification configuration if not specified
* in the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Channel withId(String id) {
setId(id);
return this;
}
/**
*
* Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.
*
*
* @param uri
* Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel
* uri.
*/
public void setUri(String uri) {
this.uri = uri;
}
/**
*
* Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.
*
*
* @return Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel
* uri.
*/
public String getUri() {
return this.uri;
}
/**
*
* Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.
*
*
* @param uri
* Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel
* uri.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Channel withUri(String uri) {
setUri(uri);
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 (getEventPublishers() != null)
sb.append("EventPublishers: ").append(getEventPublishers()).append(",");
if (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getUri() != null)
sb.append("Uri: ").append(getUri());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Channel == false)
return false;
Channel other = (Channel) obj;
if (other.getEventPublishers() == null ^ this.getEventPublishers() == null)
return false;
if (other.getEventPublishers() != null && other.getEventPublishers().equals(this.getEventPublishers()) == false)
return false;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
if (other.getUri() == null ^ this.getUri() == null)
return false;
if (other.getUri() != null && other.getUri().equals(this.getUri()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEventPublishers() == null) ? 0 : getEventPublishers().hashCode());
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getUri() == null) ? 0 : getUri().hashCode());
return hashCode;
}
@Override
public Channel clone() {
try {
return (Channel) 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.codeguruprofiler.model.transform.ChannelMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}