com.amazonaws.services.eventbridge.model.EventSource Maven / Gradle / Ivy
Show all versions of aws-java-sdk-eventbridge Show documentation
/*
* Copyright 2017-2022 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.eventbridge.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A partner event source is created by an SaaS partner. If a customer creates a partner event bus that matches this
* event source, that Amazon Web Services account can receive events from the partner's applications or services.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EventSource implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ARN of the event source.
*
*/
private String arn;
/**
*
* The name of the partner that created the event source.
*
*/
private String createdBy;
/**
*
* The date and time the event source was created.
*
*/
private java.util.Date creationTime;
/**
*
* The date and time that the event source will expire, if the Amazon Web Services account doesn't create a matching
* event bus for it.
*
*/
private java.util.Date expirationTime;
/**
*
* The name of the event source.
*
*/
private String name;
/**
*
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event
* source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or
* that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has
* since been deleted.
*
*/
private String state;
/**
*
* The ARN of the event source.
*
*
* @param arn
* The ARN of the event source.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The ARN of the event source.
*
*
* @return The ARN of the event source.
*/
public String getArn() {
return this.arn;
}
/**
*
* The ARN of the event source.
*
*
* @param arn
* The ARN of the event source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSource withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The name of the partner that created the event source.
*
*
* @param createdBy
* The name of the partner that created the event source.
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
*
* The name of the partner that created the event source.
*
*
* @return The name of the partner that created the event source.
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
*
* The name of the partner that created the event source.
*
*
* @param createdBy
* The name of the partner that created the event source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSource withCreatedBy(String createdBy) {
setCreatedBy(createdBy);
return this;
}
/**
*
* The date and time the event source was created.
*
*
* @param creationTime
* The date and time the event source was created.
*/
public void setCreationTime(java.util.Date creationTime) {
this.creationTime = creationTime;
}
/**
*
* The date and time the event source was created.
*
*
* @return The date and time the event source was created.
*/
public java.util.Date getCreationTime() {
return this.creationTime;
}
/**
*
* The date and time the event source was created.
*
*
* @param creationTime
* The date and time the event source was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSource withCreationTime(java.util.Date creationTime) {
setCreationTime(creationTime);
return this;
}
/**
*
* The date and time that the event source will expire, if the Amazon Web Services account doesn't create a matching
* event bus for it.
*
*
* @param expirationTime
* The date and time that the event source will expire, if the Amazon Web Services account doesn't create a
* matching event bus for it.
*/
public void setExpirationTime(java.util.Date expirationTime) {
this.expirationTime = expirationTime;
}
/**
*
* The date and time that the event source will expire, if the Amazon Web Services account doesn't create a matching
* event bus for it.
*
*
* @return The date and time that the event source will expire, if the Amazon Web Services account doesn't create a
* matching event bus for it.
*/
public java.util.Date getExpirationTime() {
return this.expirationTime;
}
/**
*
* The date and time that the event source will expire, if the Amazon Web Services account doesn't create a matching
* event bus for it.
*
*
* @param expirationTime
* The date and time that the event source will expire, if the Amazon Web Services account doesn't create a
* matching event bus for it.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSource withExpirationTime(java.util.Date expirationTime) {
setExpirationTime(expirationTime);
return this;
}
/**
*
* The name of the event source.
*
*
* @param name
* The name of the event source.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the event source.
*
*
* @return The name of the event source.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the event source.
*
*
* @param name
* The name of the event source.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EventSource withName(String name) {
setName(name);
return this;
}
/**
*
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event
* source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or
* that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has
* since been deleted.
*
*
* @param state
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this
* event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching
* event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but
* the event source has since been deleted.
* @see EventSourceState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event
* source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or
* that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has
* since been deleted.
*
*
* @return The state of the event source. If it is ACTIVE, you have already created a matching event bus for this
* event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching
* event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but
* the event source has since been deleted.
* @see EventSourceState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event
* source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or
* that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has
* since been deleted.
*
*
* @param state
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this
* event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching
* event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but
* the event source has since been deleted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventSourceState
*/
public EventSource withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this event
* source, and that event bus is active. If it is PENDING, either you haven't yet created a matching event bus, or
* that event bus is deactivated. If it is DELETED, you have created a matching event bus, but the event source has
* since been deleted.
*
*
* @param state
* The state of the event source. If it is ACTIVE, you have already created a matching event bus for this
* event source, and that event bus is active. If it is PENDING, either you haven't yet created a matching
* event bus, or that event bus is deactivated. If it is DELETED, you have created a matching event bus, but
* the event source has since been deleted.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EventSourceState
*/
public EventSource withState(EventSourceState state) {
this.state = state.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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getCreatedBy() != null)
sb.append("CreatedBy: ").append(getCreatedBy()).append(",");
if (getCreationTime() != null)
sb.append("CreationTime: ").append(getCreationTime()).append(",");
if (getExpirationTime() != null)
sb.append("ExpirationTime: ").append(getExpirationTime()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getState() != null)
sb.append("State: ").append(getState());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EventSource == false)
return false;
EventSource other = (EventSource) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getCreatedBy() == null ^ this.getCreatedBy() == null)
return false;
if (other.getCreatedBy() != null && other.getCreatedBy().equals(this.getCreatedBy()) == false)
return false;
if (other.getCreationTime() == null ^ this.getCreationTime() == null)
return false;
if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
return false;
if (other.getExpirationTime() == null ^ this.getExpirationTime() == null)
return false;
if (other.getExpirationTime() != null && other.getExpirationTime().equals(this.getExpirationTime()) == 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.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
hashCode = prime * hashCode + ((getExpirationTime() == null) ? 0 : getExpirationTime().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
return hashCode;
}
@Override
public EventSource clone() {
try {
return (EventSource) 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.eventbridge.model.transform.EventSourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}