/* * Copyright 2018-2023 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 global endpoint used to improve your application's availability by making it regional-fault tolerant. For more * information about global endpoints, see Making applications * Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Endpoint implements Serializable, Cloneable, StructuredPojo { /** ** The name of the endpoint. *
*/ private String name; /** ** A description for the endpoint. *
*/ private String description; /** ** The ARN of the endpoint. *
*/ private String arn; /** ** The routing configuration of the endpoint. *
*/ private RoutingConfig routingConfig; /** *
* Whether event replication was enabled or disabled for this endpoint. The default state is ENABLED
* which means you must supply a RoleArn
. If you don't have a RoleArn
or you don't want
* event replication enabled, set the state to DISABLED
.
*
* The event buses being used by the endpoint. *
*/ private java.util.List* The ARN of the role used by event replication for the endpoint. *
*/ private String roleArn; /** *
* The URL subdomain of the endpoint. For example, if the URL for Endpoint is
* https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo
.
*
* The URL of the endpoint. *
*/ private String endpointUrl; /** ** The current state of the endpoint. *
*/ private String state; /** ** The reason the endpoint is in its current state. *
*/ private String stateReason; /** ** The time the endpoint was created. *
*/ private java.util.Date creationTime; /** ** The last time the endpoint was modified. *
*/ private java.util.Date lastModifiedTime; /** ** The name of the endpoint. *
* * @param name * The name of the endpoint. */ public void setName(String name) { this.name = name; } /** ** The name of the endpoint. *
* * @return The name of the endpoint. */ public String getName() { return this.name; } /** ** The name of the endpoint. *
* * @param name * The name of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withName(String name) { setName(name); return this; } /** ** A description for the endpoint. *
* * @param description * A description for the endpoint. */ public void setDescription(String description) { this.description = description; } /** ** A description for the endpoint. *
* * @return A description for the endpoint. */ public String getDescription() { return this.description; } /** ** A description for the endpoint. *
* * @param description * A description for the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withDescription(String description) { setDescription(description); return this; } /** ** The ARN of the endpoint. *
* * @param arn * The ARN of the endpoint. */ public void setArn(String arn) { this.arn = arn; } /** ** The ARN of the endpoint. *
* * @return The ARN of the endpoint. */ public String getArn() { return this.arn; } /** ** The ARN of the endpoint. *
* * @param arn * The ARN of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withArn(String arn) { setArn(arn); return this; } /** ** The routing configuration of the endpoint. *
* * @param routingConfig * The routing configuration of the endpoint. */ public void setRoutingConfig(RoutingConfig routingConfig) { this.routingConfig = routingConfig; } /** ** The routing configuration of the endpoint. *
* * @return The routing configuration of the endpoint. */ public RoutingConfig getRoutingConfig() { return this.routingConfig; } /** ** The routing configuration of the endpoint. *
* * @param routingConfig * The routing configuration of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withRoutingConfig(RoutingConfig routingConfig) { setRoutingConfig(routingConfig); return this; } /** *
* Whether event replication was enabled or disabled for this endpoint. The default state is ENABLED
* which means you must supply a RoleArn
. If you don't have a RoleArn
or you don't want
* event replication enabled, set the state to DISABLED
.
*
ENABLED
which means you must supply a RoleArn
. If you don't have a
* RoleArn
or you don't want event replication enabled, set the state to DISABLED
.
*/
public void setReplicationConfig(ReplicationConfig replicationConfig) {
this.replicationConfig = replicationConfig;
}
/**
*
* Whether event replication was enabled or disabled for this endpoint. The default state is ENABLED
* which means you must supply a RoleArn
. If you don't have a RoleArn
or you don't want
* event replication enabled, set the state to DISABLED
.
*
ENABLED
which means you must supply a RoleArn
. If you don't have a
* RoleArn
or you don't want event replication enabled, set the state to DISABLED
.
*/
public ReplicationConfig getReplicationConfig() {
return this.replicationConfig;
}
/**
*
* Whether event replication was enabled or disabled for this endpoint. The default state is ENABLED
* which means you must supply a RoleArn
. If you don't have a RoleArn
or you don't want
* event replication enabled, set the state to DISABLED
.
*
ENABLED
which means you must supply a RoleArn
. If you don't have a
* RoleArn
or you don't want event replication enabled, set the state to DISABLED
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Endpoint withReplicationConfig(ReplicationConfig replicationConfig) {
setReplicationConfig(replicationConfig);
return this;
}
/**
* * The event buses being used by the endpoint. *
* * @return The event buses being used by the endpoint. */ public java.util.List* The event buses being used by the endpoint. *
* * @param eventBuses * The event buses being used by the endpoint. */ public void setEventBuses(java.util.Collection* The event buses being used by the endpoint. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setEventBuses(java.util.Collection)} or {@link #withEventBuses(java.util.Collection)} if you want to * override the existing values. *
* * @param eventBuses * The event buses being used by the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withEventBuses(EndpointEventBus... eventBuses) { if (this.eventBuses == null) { setEventBuses(new java.util.ArrayList* The event buses being used by the endpoint. *
* * @param eventBuses * The event buses being used by the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withEventBuses(java.util.Collection* The ARN of the role used by event replication for the endpoint. *
* * @param roleArn * The ARN of the role used by event replication for the endpoint. */ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** ** The ARN of the role used by event replication for the endpoint. *
* * @return The ARN of the role used by event replication for the endpoint. */ public String getRoleArn() { return this.roleArn; } /** ** The ARN of the role used by event replication for the endpoint. *
* * @param roleArn * The ARN of the role used by event replication for the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withRoleArn(String roleArn) { setRoleArn(roleArn); return this; } /** *
* The URL subdomain of the endpoint. For example, if the URL for Endpoint is
* https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo
.
*
abcde.veo
.
*/
public void setEndpointId(String endpointId) {
this.endpointId = endpointId;
}
/**
*
* The URL subdomain of the endpoint. For example, if the URL for Endpoint is
* https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo
.
*
abcde.veo
.
*/
public String getEndpointId() {
return this.endpointId;
}
/**
*
* The URL subdomain of the endpoint. For example, if the URL for Endpoint is
* https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo
.
*
abcde.veo
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Endpoint withEndpointId(String endpointId) {
setEndpointId(endpointId);
return this;
}
/**
* * The URL of the endpoint. *
* * @param endpointUrl * The URL of the endpoint. */ public void setEndpointUrl(String endpointUrl) { this.endpointUrl = endpointUrl; } /** ** The URL of the endpoint. *
* * @return The URL of the endpoint. */ public String getEndpointUrl() { return this.endpointUrl; } /** ** The URL of the endpoint. *
* * @param endpointUrl * The URL of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withEndpointUrl(String endpointUrl) { setEndpointUrl(endpointUrl); return this; } /** ** The current state of the endpoint. *
* * @param state * The current state of the endpoint. * @see EndpointState */ public void setState(String state) { this.state = state; } /** ** The current state of the endpoint. *
* * @return The current state of the endpoint. * @see EndpointState */ public String getState() { return this.state; } /** ** The current state of the endpoint. *
* * @param state * The current state of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. * @see EndpointState */ public Endpoint withState(String state) { setState(state); return this; } /** ** The current state of the endpoint. *
* * @param state * The current state of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. * @see EndpointState */ public Endpoint withState(EndpointState state) { this.state = state.toString(); return this; } /** ** The reason the endpoint is in its current state. *
* * @param stateReason * The reason the endpoint is in its current state. */ public void setStateReason(String stateReason) { this.stateReason = stateReason; } /** ** The reason the endpoint is in its current state. *
* * @return The reason the endpoint is in its current state. */ public String getStateReason() { return this.stateReason; } /** ** The reason the endpoint is in its current state. *
* * @param stateReason * The reason the endpoint is in its current state. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withStateReason(String stateReason) { setStateReason(stateReason); return this; } /** ** The time the endpoint was created. *
* * @param creationTime * The time the endpoint was created. */ public void setCreationTime(java.util.Date creationTime) { this.creationTime = creationTime; } /** ** The time the endpoint was created. *
* * @return The time the endpoint was created. */ public java.util.Date getCreationTime() { return this.creationTime; } /** ** The time the endpoint was created. *
* * @param creationTime * The time the endpoint was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withCreationTime(java.util.Date creationTime) { setCreationTime(creationTime); return this; } /** ** The last time the endpoint was modified. *
* * @param lastModifiedTime * The last time the endpoint was modified. */ public void setLastModifiedTime(java.util.Date lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } /** ** The last time the endpoint was modified. *
* * @return The last time the endpoint was modified. */ public java.util.Date getLastModifiedTime() { return this.lastModifiedTime; } /** ** The last time the endpoint was modified. *
* * @param lastModifiedTime * The last time the endpoint was modified. * @return Returns a reference to this object so that method calls can be chained together. */ public Endpoint withLastModifiedTime(java.util.Date lastModifiedTime) { setLastModifiedTime(lastModifiedTime); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getRoutingConfig() != null) sb.append("RoutingConfig: ").append(getRoutingConfig()).append(","); if (getReplicationConfig() != null) sb.append("ReplicationConfig: ").append(getReplicationConfig()).append(","); if (getEventBuses() != null) sb.append("EventBuses: ").append(getEventBuses()).append(","); if (getRoleArn() != null) sb.append("RoleArn: ").append(getRoleArn()).append(","); if (getEndpointId() != null) sb.append("EndpointId: ").append(getEndpointId()).append(","); if (getEndpointUrl() != null) sb.append("EndpointUrl: ").append(getEndpointUrl()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getStateReason() != null) sb.append("StateReason: ").append(getStateReason()).append(","); if (getCreationTime() != null) sb.append("CreationTime: ").append(getCreationTime()).append(","); if (getLastModifiedTime() != null) sb.append("LastModifiedTime: ").append(getLastModifiedTime()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Endpoint == false) return false; Endpoint other = (Endpoint) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getRoutingConfig() == null ^ this.getRoutingConfig() == null) return false; if (other.getRoutingConfig() != null && other.getRoutingConfig().equals(this.getRoutingConfig()) == false) return false; if (other.getReplicationConfig() == null ^ this.getReplicationConfig() == null) return false; if (other.getReplicationConfig() != null && other.getReplicationConfig().equals(this.getReplicationConfig()) == false) return false; if (other.getEventBuses() == null ^ this.getEventBuses() == null) return false; if (other.getEventBuses() != null && other.getEventBuses().equals(this.getEventBuses()) == false) return false; if (other.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; if (other.getEndpointId() == null ^ this.getEndpointId() == null) return false; if (other.getEndpointId() != null && other.getEndpointId().equals(this.getEndpointId()) == false) return false; if (other.getEndpointUrl() == null ^ this.getEndpointUrl() == null) return false; if (other.getEndpointUrl() != null && other.getEndpointUrl().equals(this.getEndpointUrl()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getStateReason() == null ^ this.getStateReason() == null) return false; if (other.getStateReason() != null && other.getStateReason().equals(this.getStateReason()) == 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.getLastModifiedTime() == null ^ this.getLastModifiedTime() == null) return false; if (other.getLastModifiedTime() != null && other.getLastModifiedTime().equals(this.getLastModifiedTime()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getRoutingConfig() == null) ? 0 : getRoutingConfig().hashCode()); hashCode = prime * hashCode + ((getReplicationConfig() == null) ? 0 : getReplicationConfig().hashCode()); hashCode = prime * hashCode + ((getEventBuses() == null) ? 0 : getEventBuses().hashCode()); hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getEndpointId() == null) ? 0 : getEndpointId().hashCode()); hashCode = prime * hashCode + ((getEndpointUrl() == null) ? 0 : getEndpointUrl().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getStateReason() == null) ? 0 : getStateReason().hashCode()); hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); hashCode = prime * hashCode + ((getLastModifiedTime() == null) ? 0 : getLastModifiedTime().hashCode()); return hashCode; } @Override public Endpoint clone() { try { return (Endpoint) 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.EndpointMarshaller.getInstance().marshall(this, protocolMarshaller); } }