com.amazonaws.services.ec2.model.CreateVpcEndpointConnectionNotificationRequest Maven / Gradle / Ivy
/*
* Copyright 2013-2018 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.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.Request;
import com.amazonaws.services.ec2.model.transform.CreateVpcEndpointConnectionNotificationRequestMarshaller;
/**
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateVpcEndpointConnectionNotificationRequest extends AmazonWebServiceRequest implements Serializable, Cloneable,
DryRunSupportedRequest {
/**
*
* The ID of the endpoint service.
*
*/
private String serviceId;
/**
*
* The ID of the endpoint.
*
*/
private String vpcEndpointId;
/**
*
* The ARN of the SNS topic for the notifications.
*
*/
private String connectionNotificationArn;
/**
*
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*
*/
private com.amazonaws.internal.SdkInternalList connectionEvents;
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* How to Ensure
* Idempotency.
*
*/
private String clientToken;
/**
*
* The ID of the endpoint service.
*
*
* @param serviceId
* The ID of the endpoint service.
*/
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
/**
*
* The ID of the endpoint service.
*
*
* @return The ID of the endpoint service.
*/
public String getServiceId() {
return this.serviceId;
}
/**
*
* The ID of the endpoint service.
*
*
* @param serviceId
* The ID of the endpoint service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcEndpointConnectionNotificationRequest withServiceId(String serviceId) {
setServiceId(serviceId);
return this;
}
/**
*
* The ID of the endpoint.
*
*
* @param vpcEndpointId
* The ID of the endpoint.
*/
public void setVpcEndpointId(String vpcEndpointId) {
this.vpcEndpointId = vpcEndpointId;
}
/**
*
* The ID of the endpoint.
*
*
* @return The ID of the endpoint.
*/
public String getVpcEndpointId() {
return this.vpcEndpointId;
}
/**
*
* The ID of the endpoint.
*
*
* @param vpcEndpointId
* The ID of the endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcEndpointConnectionNotificationRequest withVpcEndpointId(String vpcEndpointId) {
setVpcEndpointId(vpcEndpointId);
return this;
}
/**
*
* The ARN of the SNS topic for the notifications.
*
*
* @param connectionNotificationArn
* The ARN of the SNS topic for the notifications.
*/
public void setConnectionNotificationArn(String connectionNotificationArn) {
this.connectionNotificationArn = connectionNotificationArn;
}
/**
*
* The ARN of the SNS topic for the notifications.
*
*
* @return The ARN of the SNS topic for the notifications.
*/
public String getConnectionNotificationArn() {
return this.connectionNotificationArn;
}
/**
*
* The ARN of the SNS topic for the notifications.
*
*
* @param connectionNotificationArn
* The ARN of the SNS topic for the notifications.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcEndpointConnectionNotificationRequest withConnectionNotificationArn(String connectionNotificationArn) {
setConnectionNotificationArn(connectionNotificationArn);
return this;
}
/**
*
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*
*
* @return One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*/
public java.util.List getConnectionEvents() {
if (connectionEvents == null) {
connectionEvents = new com.amazonaws.internal.SdkInternalList();
}
return connectionEvents;
}
/**
*
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*
*
* @param connectionEvents
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*/
public void setConnectionEvents(java.util.Collection connectionEvents) {
if (connectionEvents == null) {
this.connectionEvents = null;
return;
}
this.connectionEvents = new com.amazonaws.internal.SdkInternalList(connectionEvents);
}
/**
*
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setConnectionEvents(java.util.Collection)} or {@link #withConnectionEvents(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param connectionEvents
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcEndpointConnectionNotificationRequest withConnectionEvents(String... connectionEvents) {
if (this.connectionEvents == null) {
setConnectionEvents(new com.amazonaws.internal.SdkInternalList(connectionEvents.length));
}
for (String ele : connectionEvents) {
this.connectionEvents.add(ele);
}
return this;
}
/**
*
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
*
*
* @param connectionEvents
* One or more endpoint events for which to receive notifications. Valid values are Accept
,
* Connect
, Delete
, and Reject
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcEndpointConnectionNotificationRequest withConnectionEvents(java.util.Collection connectionEvents) {
setConnectionEvents(connectionEvents);
return this;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* How to Ensure
* Idempotency.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see How to Ensure
* Idempotency.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* How to Ensure
* Idempotency.
*
*
* @return Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see How to Ensure
* Idempotency.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see
* How to Ensure
* Idempotency.
*
*
* @param clientToken
* Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more
* information, see How to Ensure
* Idempotency.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVpcEndpointConnectionNotificationRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
* This method is intended for internal use only. Returns the marshaled request configured with additional
* parameters to enable operation dry-run.
*/
@Override
public Request getDryRunRequest() {
Request request = new CreateVpcEndpointConnectionNotificationRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getServiceId() != null)
sb.append("ServiceId: ").append(getServiceId()).append(",");
if (getVpcEndpointId() != null)
sb.append("VpcEndpointId: ").append(getVpcEndpointId()).append(",");
if (getConnectionNotificationArn() != null)
sb.append("ConnectionNotificationArn: ").append(getConnectionNotificationArn()).append(",");
if (getConnectionEvents() != null)
sb.append("ConnectionEvents: ").append(getConnectionEvents()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateVpcEndpointConnectionNotificationRequest == false)
return false;
CreateVpcEndpointConnectionNotificationRequest other = (CreateVpcEndpointConnectionNotificationRequest) obj;
if (other.getServiceId() == null ^ this.getServiceId() == null)
return false;
if (other.getServiceId() != null && other.getServiceId().equals(this.getServiceId()) == false)
return false;
if (other.getVpcEndpointId() == null ^ this.getVpcEndpointId() == null)
return false;
if (other.getVpcEndpointId() != null && other.getVpcEndpointId().equals(this.getVpcEndpointId()) == false)
return false;
if (other.getConnectionNotificationArn() == null ^ this.getConnectionNotificationArn() == null)
return false;
if (other.getConnectionNotificationArn() != null && other.getConnectionNotificationArn().equals(this.getConnectionNotificationArn()) == false)
return false;
if (other.getConnectionEvents() == null ^ this.getConnectionEvents() == null)
return false;
if (other.getConnectionEvents() != null && other.getConnectionEvents().equals(this.getConnectionEvents()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServiceId() == null) ? 0 : getServiceId().hashCode());
hashCode = prime * hashCode + ((getVpcEndpointId() == null) ? 0 : getVpcEndpointId().hashCode());
hashCode = prime * hashCode + ((getConnectionNotificationArn() == null) ? 0 : getConnectionNotificationArn().hashCode());
hashCode = prime * hashCode + ((getConnectionEvents() == null) ? 0 : getConnectionEvents().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
return hashCode;
}
@Override
public CreateVpcEndpointConnectionNotificationRequest clone() {
return (CreateVpcEndpointConnectionNotificationRequest) super.clone();
}
}